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)
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"
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