BUzzbomb23
New member
- Local time
- Today, 10:39
- Joined
- Dec 20, 2019
- Messages
- 6
We're switching over from Access 2003 to Access 2007 & have a mix. of Windows 7 (32 bit) & Windows 10 (64 bit) machines. I'm having problems converting some mdb databases to accdb, where code works on the several machines, but not on my Win 7 (32 bit) work laptop.
The problem occurs when I try to open an Excel spreadsheet within Access VBA. The spreadsheet opens ok but on Win 7 (32 bit) machines, it gives a 1004 error when I try to create a reference to the workbook.
I've replicated the error on a 2nd Win7 (32 bit) laptop... & code has worked fine in the past with Access 2003 & on other machines (inc my home Win 7 (64-bit).
I'm stumped by the problem - any help much appreciated! :banghead:
Ivor
The problem occurs when I try to open an Excel spreadsheet within Access VBA. The spreadsheet opens ok but on Win 7 (32 bit) machines, it gives a 1004 error when I try to create a reference to the workbook.
I've replicated the error on a 2nd Win7 (32 bit) laptop... & code has worked fine in the past with Access 2003 & on other machines (inc my home Win 7 (64-bit).
I'm stumped by the problem - any help much appreciated! :banghead:
Ivor
Code:
Dim xlApp As Excel.Application
Dim xlbook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
xlApp.Workbooks.Open "[path to xlsx file]"
xlApp.Visible = True
Set xlbook = xlApp.Workbooks.Item(1) 'Error occurs here...