dbTalk Databases Forums  

Excel automation causes runtime error 1004 on second attempt

comp.database.ms-access comp.database.ms-access


Discuss Excel automation causes runtime error 1004 on second attempt in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mark C
 
Posts: n/a

Default 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.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.