S
Stu H
I have an Access VBA procedure that uses Excel by automation and opens
different Excel Workbooks 1 at a time.
Some data is manipulated and added to a new sheet inserted in th
workbook and the workbook is saved under a new name. The workbook i
closed before opening another.
No matter which workbook I open 1st all code executes correctly. Bu
when I try to open the second as soon as code that cites a specifi
range or sheet is encountered I receive the following message:
"Method 'Sheets' of object '_Global' failed."
The problem has something to do with the fact that another workbook wa
opened before.
The code is in Access and includes:
objExcel = New Excel.Application
Set xlsFarEastBOM = objExcel.Workbooks.Open(strFileAndPath)
At the end of the procedure, I close the active workbook and have th
following code
objExcel.Quit
set objExcel = nothing
A different procedure is then called to do the similar routine with
different workbook
different Excel Workbooks 1 at a time.
Some data is manipulated and added to a new sheet inserted in th
workbook and the workbook is saved under a new name. The workbook i
closed before opening another.
No matter which workbook I open 1st all code executes correctly. Bu
when I try to open the second as soon as code that cites a specifi
range or sheet is encountered I receive the following message:
"Method 'Sheets' of object '_Global' failed."
The problem has something to do with the fact that another workbook wa
opened before.
The code is in Access and includes:
objExcel = New Excel.Application
Set xlsFarEastBOM = objExcel.Workbooks.Open(strFileAndPath)
At the end of the procedure, I close the active workbook and have th
following code
objExcel.Quit
set objExcel = nothing
A different procedure is then called to do the similar routine with
different workbook