LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro crashes if option "yes" is not chosen


Hi everyone,

I have a macro called "generate".

The following part of the code if giving me lot of grief:

ActiveWorkbook.SaveAs FileName:=Fname, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

If there is a file by the name Fname, then it asks whether it should be
replaced or not. If you click "Yes" it works fine, but if you choose
"No" or "Cancel" it crashes with the following message:

Runtime Error '1004':
Method 'SaveAs' of Object "_Workbook" failed

Any help would be appreciated!

S


--
schoujar
------------------------------------------------------------------------
schoujar's Profile: http://www.excelforum.com/member.php...o&userid=26574
View this thread: http://www.excelforum.com/showthread...hreadid=468109

 
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
2007 Need macro to auto set option buttons all to "Yes" or "No" Paula Excel Worksheet Functions 1 October 20th 09 08:07 PM
Why is the "zoom" option grayed out in "print preview?" sschreiber Excel Discussion (Misc queries) 0 November 29th 07 04:42 PM
"assign macro" not an option from short menu SteveJ Excel Discussion (Misc queries) 2 May 18th 06 05:55 PM
pictures to work with "data" "sort" option arad Excel Discussion (Misc queries) 1 April 18th 06 09:15 PM
commnd button - when i rt click, "assign macro" isnt an option... kevin[_3_] Excel Programming 1 November 12th 04 09:52 PM


All times are GMT +1. The time now is 12:37 AM.

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

About Us

"It's about Microsoft Excel"