question

reinht avatar image
0 Votes"
reinht asked reinht commented

ADO.Open crashes Excel 2010

My Excel VBA application has to run from Excel 2010. But recently the following code will crash Excel 2010. Excel 2019/365 is working.

 '\Reference: Microsoft ActiveX Data Object 6.1 Library
 Sub Excel2010Crash()
       
   '\This line will crash Excel 2010
   ADODB.Connection.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\JohnDoe\Documents\AnyDatabase.accdb"
      
 End Sub

"C:\Program Files (x86)\Common Files\System\ado\msado15.dll" is version 10.0.19041.746.

Any ideas to overcome this issue?

TIA
Reinhard

office-vba-devoffice-excel-itprooffice-scripts-excel-dev
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

A correction! Code needs to be:

 '\Reference: Microsoft ActiveX Data Object 6.1 Library
 Sub Excel2010Crash()
   Dim CN As ADODB.Connection
   Set CN = New ADODB.Connection
    
   '\This line will crash Excel 2010
   CN.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\JohnDoe\Documents\AnyDatabase.accdb"
    
 End Sub
0 Votes 0 ·

1 Answer

Castorix31 avatar image
0 Votes"
Castorix31 answered reinht commented

From Google, there are threads about the connection string, like :
Excel 2010 crashes when attempting to open ADODB.Connection


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This workaround is not working for *.accdb files!

125178-2021-08-21-13-28-01.png


0 Votes 0 ·