Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
the file already exists - do you want to replace the existing file?
I've got a VBA procedure that saves a record to disk using
Application.GetSaveAsFilename. However, if the file it's trying to save already exists, the Windows API generates the above message, and the user's only option is to either replace the existing file, or manually rename the existing file in the File Save As. What I'd really like to do is modify the code so that when it's run, it takes care of renaming the existing file (if it exists) by adding a "1" to the end of the filename, then saving the file in memory with the original name, all without requiring the user to do anything. For simplicity, I'd be happy to keep appending the character "1" to the end of any previously renamed files in case this operation is performed multiple times, instead of trying to increase the appended digit by 1 each time. Is there any VBA code I can use to accomplish this? Thanks in advance. Paul |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
User replaces existing file with blank during file open | Excel Discussion (Misc queries) | |||
Importing text file, only option to edit existing file | Excel Discussion (Misc queries) | |||
can i save an existing .xls file as a .csv file using command line | Excel Discussion (Misc queries) | |||
How do you replace an existing file, saying "yes" in a macro? | Excel Programming | |||
Automatically replace existing file on save | Excel Programming |