Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How come my macro works if I pause and play again?

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default How come my macro works if I pause and play again?

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

NickHK

"Kenji" wrote in message
...
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How come my macro works if I pause and play again?

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)

"Kenji" wrote in message
...
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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default How come my macro works if I pause and play again?

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

In article , kenji4861
@burningmail.com says...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
pause a macro tsmith Excel Discussion (Misc queries) 9 January 22nd 09 12:47 AM
How do I pause a macro? Dave H Excel Discussion (Misc queries) 5 May 3rd 08 04:53 PM
Pause Macro 2 Ollie Excel Discussion (Misc queries) 3 June 15th 06 04:49 AM
Pause during a Macro Marie[_3_] Excel Programming 6 January 18th 04 12:18 PM
Pause macro Bill Barclift Excel Programming 0 September 30th 03 09:22 PM


All times are GMT +1. The time now is 02:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"