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.
Downloading the Office System Drivers
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.
Once you click Download it will prompt you to select the architecture i.e. 32 BIT (x86) or 64 BIT (x64).
If still you are getting error and if the error is in Visual Studio then you will need to check the architecture of the Visual Studio application.
In order to check, you will need to open Task Manager and then look for devevn.exe which is the name of the EXE file of Visual Studio if it shows *32 it means that the Visual Studio is a 32 BIT application.
Thus in such case, you will need to uninstall the 64 BIT (x64) version of the driver and then will need to download and install 32 BIT version of Microsoft Access Database Engine 2010 Redistributable file.