*************Update on 29 OCT 2011*****************
*********Read at the bottom of this article**************
I recently got an error when trying to use Microsoft.ACE.OLEDB.12.0 to connect excel file.I am sure Microsoft.ACE.OLEDB.12.0 is registered on the local machine,but I keep getting on run time error like this.

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
After quite long time goolgling,I found out that it is because I am running 64-bit windows and there are no MS Access drivers that run 64 bit.So to resolve it you need to change the build configuration to x86 found in the programs properties.
To do so,right click on the project and click Properties
Then click on Build and change the Platform target from Any CPU to x86.Recompile your program , it works like charm.

*************Update on 5 March 2011*****************
If for some reasons (e.g. migrate import or export function using excel in SharePoint2010,SharePoint2010 only comes with 64 bit), you have to compile your project in 64 bit , you can use the open-XML to do so , but keep in mind only office2007 or above saving the office file in openxml format.Here are the references to get you started.You can download a working example here.
http://www.sadev.co.za/content/reading-and-writing-excel-2007-or-excel-2010-c-series-index
http://msdn.microsoft.com/en-us/library/gg575571.aspx
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&displaylang=en
http://openxmldeveloper.org/attachment/1970.ashx
*************Update on 5 March 2011*****************
*************Update on 29 OCT 2011*****************
Another Solution is to install the 64 bit driver for Access Database Engine.
