Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default GetSaveAsFileName to prompt for overwriting?

Alternatively, put the GetSaveAsFileName inside a Do Loop. When the user
inputs a file name, do Dir() or the equivalent to see if the file exists. If
so, offer the choice of overwriting (in which case you exit the loop) or
trying to enter an unused name; if not, exit the loop.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Jim Thomlinson" wrote in message
...
Why not just use the SaveAs dialog then?

Application.Dialogs(xlDialogSaveAs).Show "MyFile.xls"
--
HTH...

Jim Thomlinson


"simonc" wrote:

GetSaveAsFileName only returns the path where you want to write the file,
without any checking or actual saving. How do you code a check that if
this
file already exists it asks if you want to overwrite it or not, and, if
you
decide not, would keep the GetSaveAsFileName dialog open so you can type
in a
new file name? (ie, exactly the behaviour you get when you use SaveAs in
Microsoft Excel).

Grateful for any help.



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
GetSaveAsFilename Syed Zeeshan Haider Excel Programming 2 December 8th 06 06:53 PM
Help with GetSaveAsFilename aj Excel Programming 0 March 23rd 06 08:32 PM
GetSaveasFileName Libby Excel Programming 1 September 8th 05 07:45 PM
GetSaveAsFileName Greg Hadrych Excel Programming 1 July 29th 04 12:52 AM
Overwriting an existing workbook without having to click yes in the prompt box Ian M[_2_] Excel Programming 2 May 3rd 04 03:41 AM


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