Excel crashes when I try access Access DB

0

Symptoms:

When I my code runs the following code Excel abruptly closes.

Private Sub OpenConnection()

   If Not (DBCon.State And adStateOpen) = adStateOpen Then DBCon.Open "Provider = Microsoft.ACE.OLEDB.12.0; data source=C:\Users\bissonp\Desktop\ai\ai2.accdb;"

End Sub 

References in Excel VBA are as follows

Visual Basic For Applications

Microsoft Excel 15.0 Object Library

OLE Automation

Microsoft Office 15.0 Object Library

Microsoft ActiveX Data Objects 6.1 Library

Microsoft Scripting Runtime

Microsoft DAO 3.6 Object Library

Both Excel and Access are 64-Bit

I have run this program on a computer with MS Excel and Access 2016 and it works. Any suggestions as to how to solve Excel crashing. Thanks.

Edit: Using Event viewer as suggested in the comments I have the following errors

Faulting application name: EXCEL.EXE, version: 15.0.5045.1000, time stamp: 0x5b0d303b
Faulting module name: mso.dll, version: 0.0.0.0, time stamp: 0x5b1fa456
Exception code: 0xc0000005
Fault offset: 0x00000000005b0e04
Faulting process id: 0x4f00
Faulting application start time: 0x01d4305c562934ce
Faulting application path: C:\Program Files\Microsoft Office\Root\Office15\EXCEL.EXE
Faulting module path: C:\Program Files\Common Files\Microsoft Shared\Office15\mso.dll
Report Id: 7450046f-8670-463f-b15f-48faccf15016
Faulting package full name: 
Faulting package-relative application ID: 

AND

Fault bucket 1277345556296028794, type 4
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: EXCEL.EXE
P2: 15.0.5045.1000
P3: 5b0d303b
P4: mso.dll
P5: 0.0.0.0
P6: 5b1fa456
P7: c0000005
P8: 00000000005b0e04
P9: 
P10: 

Attached files:
\\?\C:\Users\pasca\AppData\Local\Temp\1828426875.cvr
\\?\C:\Users\pasca\OneDrive\Desktop\ai\ai2.xlsm
\\?\C:\Users\pasca\AppData\Local\Temp\CVR6E26.tmp.cvr
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER9584.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER95A4.tmp.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER95C3.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER95E3.tmp.txt

These files may be available here:
C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_EXCEL.EXE_274d175a8bce6eaa415e2ad0764c80f2fd668880_00000000_748b9a18

Analysis symbol: 
Rechecking for solution: 0
Report Id: 7450046f-8670-463f-b15f-48faccf15016
Report Status: 2147487744
Hashed bucket: 2c96ba3a635c42dce1ba0b040a72d27a
Cab Guid: 0
excel
vba
excel-2013
ms-access-2016
asked on Stack Overflow Aug 9, 2018 by Tolure • edited Jul 7, 2020 by Martijn Pieters

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0