I am building a tool which extracts and compares VBA code modules between 2 versions of the same database. The tool is being built in Excel VBA.
Unfortunately these databases tend to have message boxes which appear on screen when opened, and usually prompts to compact the database on closure. This means that when I attempt to open the databases to pick up the VBA code the Excel VBA code hangs until the Access message boxes have been responded to.
However, strangely I have found that when I step through the Excel VBA code to open the databases the on open and close messages do not appear, and I am able to extract all VBA code modules without any problem.
Is there any way that an Access database can be opened like this without the Access VBA code firing, but without me having to step through the code in Excel? The code I am using to connect to the databases is:
Set dbLatest = New Access.Application
dbLatest.OpenCurrentDatabase LatestDatabasePath
Set projLatest = dbLatest.VBE.ActiveVBProject
Set dbPrevious = New Access.Application
dbPrevious.OpenCurrentDatabase PreviousDatabasePath
Set projPrevious = dbLatest.VBE.ActiveVBProject