I'm working on sharepoint 2010. I want to know if it's possible to create a button which extract the list the infopath is based on in an excel sheet. Thanks.
I assume that "the list the infopath is based on" means that you are talking about a SharePoint list form that you are customising with InfoPath.
In that case, the answer is: No, you cannot create a button in the form that extracts the whole list to Excel. Such functionality would require code that is not available in InfoPath list forms.
You can export the SharePoint list view to Excel using the ribbon button in the browser.