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: 18
Default SaveAs command when a file already exists?

Hi Everybody,

I have a "CommandButton" on a Worksheet which implements the the "Save" and
"SaveAs" features normally found in the "File" menu. The click event
implements logic which decides whether to execute the "ActiveWorkbook.Save"
or the "ActiveWorkbook.SaveAs (FileName)" command.

My problem is when the .SaveAs command is executed and an existing file
exists with the same file name is in the target directory, the user gets a
message box asking whether the existing file should be overwritten. This
message box is a feature of Excel and Windows itself i.e. I'm not
implementing custom code for this feature to happen. If the user selects the
"Cancel" button I need to make sure my code for "ActiveWorkbook.SaveAs
(FileName)" isn't executed.

Is there a way to pick-up whether the user selects "Cancel"?

Thanks for any help!
Sam

P.S. I'm using Excel 97.


 
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
Confused here Prevent Saving File - but allow ONLY File SAVEAS Met JMay Excel Discussion (Misc queries) 2 June 17th 07 04:37 PM
Checking to see that a CHART exists prior to running a simple command Anton Excel Discussion (Misc queries) 0 August 29th 06 06:30 AM
saveas CSV file stevekirk Excel Discussion (Misc queries) 0 August 10th 06 01:11 PM
File Exists Mike McLellan Excel Discussion (Misc queries) 2 May 4th 06 09:20 AM
the file already exists - do you want to replace the existing file? Paul James[_3_] Excel Programming 4 December 12th 03 02:50 AM


All times are GMT +1. The time now is 07:04 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"