ADO Connection to Excel : Excel 2010

Stephen_James

New Member
Joined
Dec 22, 2014
Messages
4
I recently upgraded my computer to a 64 bit computer, however, Excel (2010) on my computer is 32 bit. I have the following ADO connection that worked fine on my old computer, but now gives me a 3706 run time error:


conStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & strDir1 & "';" & _
"Extended Properties=""Excel 12.0;HDR=YES;IMEX=1;"";"


I have the reference to MS ActiveX Data Objects 6.1 library checked, so that is not the issue.

Does anybody know how to fix this? I tried Google for over an hour and couldn't find a specific fix. I believe it is due to the conflict between my 64 bit OS and my 32 bit Office Application, but that is just a hunch.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Instead of the OLEDB driver you might be able to use the Excel driver instead.

Code:
Sub TestConnectionString()

Dim pCN As Object
Dim Path As String


  Path = "C:\Users\Locke\Desktop\Book1.xlsx"
  
  Set pCN = CreateObject("ADODB.Connection")
  Call pCN.Open("DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" & Path)
  Call pCN.Close
  
  MsgBox "Successfully Connected"
  
End Sub

You might also try downloading and installing the 64 bit version of the Access Database Engine.

Access Denied
 
Last edited:
Upvote 0
I'm not sure why that link says "Access Denied". When I click on it it redirects me fine to Microsoft's website. Hopefully it does the same for you. If not just try putting the following into a search engine and it should be the first result:

Microsoft Access Database Engine 2010 Redistributable site:microsoft.com
 
Upvote 0
After some clicking around/modifying the report, I was able to get this different method to work. Thanks for the information.
 
Upvote 0

Forum statistics

Threads
1,215,674
Messages
6,126,149
Members
449,294
Latest member
Jitesh_Sharma

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top