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

  • Thread starter Thread starter kenji4861
  • Start date Start date
K

kenji4861

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 g
through
just fine. Is there a fix for this
 
Kenji,

Not tried, but strings are concatenated by & not +, so try

ThisWorkbook.SaveCopyAs Application.DefaultFilePath & "\" & "temp.xls"


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Bob, "+" and "&" gives the same result.

Also this code does work, if I press "play" again.. so I'm not sur
what's going on
 
Sorry, it was just a thought.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top