Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

excel

vba

oledb

jet

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"

like image 459
Tejas Avatar asked Sep 19 '12 13:09

Tejas


1 Answers

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

like image 95
Alex K. Avatar answered Nov 19 '22 13:11

Alex K.