If you get this error
Exception calling “Open” with “0” argument(s): “The ‘Microsoft.Jet.OLEDB.4.0’ provider is not registered on the local machine.”
Microsoft OLEDB Drivers work on 32 or 64 bit architecture, running Windows XP, Vista, 7 or Windows 8.
Some of the drivers are only 32 Bit compatible ! like this above one.
Additionally on some Windows 64 bit systems, it is possible that some of the Microsoft OLEDB DLLs have not been registered.
Solution No. 1
Check that you are running the 32 bit PowerShell Console or ISE. In the past with Powershell v1.0 you could start it form here :
But later on after upgrading to v3.0 it disappeared.There are still 2 hints where you can see if you are running x64 or x86.After starting the ISE
The command window you see the location SysWOW64
You can start it from here :
The Solution No. 2.
The solution is to manually register those DLLs.
go to Start->Run and type cmd
this starts the Command Prompt
Go to a special folder
Now you need to register the OLE DB 4.0 DLLs by typing these commands and pressing return after each. Might be only the first 2 will register, no problem.
If errors appear.
Install AccessDatabaseEngine.exe from the MS site and try again.
x86 for MS Office x32 bit and
x64 for MS Office x64 bit
Hope this will help solving some frustrations.