Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have an Excel workbook that reads data from an Access database and copies it into spreadsheet tables. That works fine on my PC, but there is a problem for anyone who has a different version of MDAC installed on their PC. In this case, it fails immediately (i.e. before any of my code is executed) with the awful error message "Compile error in hidden module". A check to find the item (ADODB in this case) in Application.VBE.ActiveVBProject.References works correctly for all OK references, but is irrelevant if the reference is not OK because the exception occurs before the code is called, and "Compile error in hidden module" is reported anyway. The check is in my Sub CheckRefs, which is called directly from Workbook_Open; like Workbook_Open, the sub is in ThisWorkbook. A similar check in Word - to ensure that the global template AddIn has been installed - works correctly provided that direct references to routines in the global template are avoided within routines in ThisDocument, i.e. Document_New, Document_Open, etc. The exception can therefore be controlled in Word. Is Workbook_Open the earliest event on which I can hang the code? The documentation on MSDN says this occurs before Auto_Open. Is there any technique by which references in Excel may be checked before the exception for the missing reference is raised? Regards, JPL |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Disable sheet reference check | Excel Worksheet Functions | |||
Check-box relative reference | Excel Discussion (Misc queries) | |||
Check Box reference name | Excel Discussion (Misc queries) | |||
Check If COM Reference Available on Machine | Excel Programming | |||
ADODB | Excel Programming |