In this article I will explain how to resolve the error The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. This error occurs when you try to make use of Excel 2007 or higher or Access 2007 or higher files using OLEDB connection in C# or VB.Net.
This happens only for Office 2007 or higher as it requires use of OLEDB ACE drivers for connection which do not come by default in Windows and hence we need to install them in order to get rid of this error.
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
 
Downloading the Office System Drivers
You need to visit the following download link for downloading 2007 Office System Driver: Data Connectivity Components.
You need to click the Download button shown in the below screenshot.
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
I am not sure but these drivers seems to me of 32 BIT (x86) architecture and will work for most of you. In case you still get errors I would suggest to download the Microsoft Access Database Engine 2010 Redistributable using the following download link.
You need to click the Download button shown in the below screenshot.
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
Once you click Download it will prompt you to select the architecture i.e. 32 BIT (x86) or 64 BIT (x64).
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
Now here I selected 64 BIT (x64) as my system is 64 BIT but after installing it I was still getting the same error. Hence I decided to further investigate and found that my Visual Studio 2010 is of 32 BIT (x86) architecture from the task manager. The below screenshot displays the file devevn.exe*32.
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
And hence I first uninstalled the 64 BIT (x64) version of the driver and then downloaded and installed the 32 BIT (x86) version and then it worked for me.