Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do you replace an existing file, saying "yes" in a macro?
Ok, I have a macro set up that creates an excel file using
different criteria. I have it create 5 "alternatives" that each is a different file. After 5, you are not allowed to create any more. If you try to create another one, a message box pops up saying, do you want to replace the existing file? The file already exists, and if you say "no", or hit "cancel", my macro bombs out because of the saveas property. Here is an example of my code: ActiveWorkbook.SaveAs ("C:\" & pname & "-" & tod_month & "_" & tod_day & "_" & tod_year & "_" & Alt_Name) ActiveWorkbook.Close It always bombs out at the SaveAS line. Any help would be greatly appreciated. Email me if you have a solution. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
"Find" a wildcard as a place marker and "replace" with original va | Excel Discussion (Misc queries) | |||
Insert "Proper Function" into existing macro | Excel Worksheet Functions | |||
Macro to Replace/Delete Text Using "Watchword" List? | Excel Discussion (Misc queries) | |||
Replace dialog should put focus on "Find What" not "Replace With" | Excel Discussion (Misc queries) | |||
"Go ahead and replace file" command? | Excel Programming |