My code is simple enough. I have an Excel 2003 workbook with macros, and it's just trying to open an Access database in the same folder as the workbook. It works on WinXP/Office2003, but on Win7/Office2010. Its references are (in 2010):
- Visual Basic for Applications
- Microsoft Excel 14.0 Object Library
- OLE Automation
- Microsoft Office 14.0 Object Library
- Microsoft Forms 2.0 Object Library
- Microsoft DAO 3.6 Object Library
- Windows Script Host Object Model
All these are the same as on my 2003 system, except that "14.0" is "11.0". In Win7/Office2010, when the Set statement runs, I get "Run-time error -2147024770 (8007007e) Automation error / The specified module could not be found."; in WinXP/2003 it's fine.
What's going on?
<CODE>
Public DBobj As DAO.database
Public Const Pwd$ = "MyDatabasePassword"
Public Sub OpenDatabase() ' Open the main database shared (False) and read-only (True)
If DBobj Is Nothing Then Set DBobj = DBEngine.OpenDatabase(ThisWorkbook.Path & "\MyDatabase.mdb", False, True, "MS Access;PWD=" & Pwd$)
End Sub
</CODE>
- Visual Basic for Applications
- Microsoft Excel 14.0 Object Library
- OLE Automation
- Microsoft Office 14.0 Object Library
- Microsoft Forms 2.0 Object Library
- Microsoft DAO 3.6 Object Library
- Windows Script Host Object Model
All these are the same as on my 2003 system, except that "14.0" is "11.0". In Win7/Office2010, when the Set statement runs, I get "Run-time error -2147024770 (8007007e) Automation error / The specified module could not be found."; in WinXP/2003 it's fine.
What's going on?
<CODE>
Public DBobj As DAO.database
Public Const Pwd$ = "MyDatabasePassword"
Public Sub OpenDatabase() ' Open the main database shared (False) and read-only (True)
If DBobj Is Nothing Then Set DBobj = DBEngine.OpenDatabase(ThisWorkbook.Path & "\MyDatabase.mdb", False, True, "MS Access;PWD=" & Pwd$)
End Sub
</CODE>
Last edited: