Excel automation causes runtime error 1004 on second attempt -
07-11-2004
, 10:48 PM
All,
I have used Excel automation many times in the past without error until now.
My machine has both Access 97 and XP installed but this code is written in
97 and I am using Excel XP. The code below is running in my database:
Dim exl As Excel.Application
Set exl = New Excel.Application
exl.Workbooks.Open ("C:\Test\ Listing.xls")
Excel.Run "sheet1.LFooter"
Excel.Workbooks(1).Close True
Set exl = Nothing
The first time it runs it runs without error. If I try to run it again
without first closing the database I get a runtime error 1004 'The macro
sheet1.LFooter can't be found'. I have also gotten this same runtime error
1004 with different messages during different attempts. If I close the
database after the first run it works fine. I have the Excel reference
checked as well. Any help would be much appreciated.
Thanks in advance,
Mark C. |