Microsoft.Jet.OLEDB.4.0 - Provider can not be found or it may not be installed

Tejas picture Tejas · Sep 19, 2012 · Viewed 22.2k times · Source

I have created an Excel Macro in which I have used Microsoft.Jet.OLEDB.4.0 to fire query on Excel work sheets.

It's working perfect on my machine but my client is facing issue with it. (see the attached screen print)

Client is getting this error

References I have added in the program

Here are details for my Connection Object:

Dim cn
Set cn = CreateObject("ADODB.Connection")
With cn
    .Provider = "Microsoft.Jet.OLEDB.4.0"
    .ConnectionString = "Data Source=" & ThisWorkbook.FullName & "; Extended Properties=Excel 8.0"
    .Open
End With

Please Note: It is must for me to make the code working in "Windows 7"

Answer

Alex K. picture Alex K. · Sep 19, 2012

The provider will fail like that on Window 7 Office x64 as the provider isn't supported on that platform.

You need to install the x64 Microsoft Access Database Engine 2010 Redistributable and change your connection string to Provider=Microsoft.ACE.OLEDB.12.0