How come my macro works if I pause and play again?

  • Thread starter Thread starter Kenji
  • Start date Start date
K

Kenji

I have this code

----
ThisWorkbook.SaveCopyAs Application.DefaultFilePath + "\" + "temp.xls"
----

When I run the macro from the front page, it'll give an, "Method
'SaveCopyAs' of object '_Workbook' failed.
however, if I click debug and hit "play" again, the code will go through
just fine. Is there a fix for this?

Kenji
 
Kenji,
What's the value of "Application.DefaultFilePath" ?

NickHK
 
See my response in .Misc.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
When and how is the code executed? Is it part of an event procedure?

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top