Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Accept Overwrite Automatically
Hi,
I have a file that I want to save in 2 different places so I always have an up to date backup copy. I also want to be able to modif y either copy and have the most current file in both places. Using the code below I get a prompt asking if I want to overwrite the current file. Is there a way to Accept the Overwrite Automatically? Thanks, Mike ChDir "H:\" ActiveWorkbook.SaveAs Filename:="H:\Hours.xls", FileFormat:=xlNormal, _ Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False ChDir "H:\SX56 My Documents\Excel" ActiveWorkbook.SaveAs Filename:="H:\SX56 My Documents\Excel\Hours.xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Accept Overwrite Automatically
Application.DisplayAlerts = False
ChDir "H:\" ActiveWorkbook.SaveAs Filename:="H:\Hours.xls", FileFormat:=xlNormal, _ Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False ChDir "H:\SX56 My Documents\Excel" ActiveWorkbook.SaveAs Filename:="H:\SX56 My Documents\Excel\Hours.xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False Application.DisplayAlerts = True If you don't want to change the name of the open workbook, look at SaveCopyAs -- Regards, Tom Ogilvy "Reed" wrote in message ... Hi, I have a file that I want to save in 2 different places so I always have an up to date backup copy. I also want to be able to modif y either copy and have the most current file in both places. Using the code below I get a prompt asking if I want to overwrite the current file. Is there a way to Accept the Overwrite Automatically? Thanks, Mike ChDir "H:\" ActiveWorkbook.SaveAs Filename:="H:\Hours.xls", FileFormat:=xlNormal, _ Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False ChDir "H:\SX56 My Documents\Excel" ActiveWorkbook.SaveAs Filename:="H:\SX56 My Documents\Excel\Hours.xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Save As / Overwrite | Excel Discussion (Misc queries) | |||
VBA to automatically test for file, update, overwrite | Excel Discussion (Misc queries) | |||
Overwrite Changes when saving | Charts and Charting in Excel | |||
Q: overwrite during saveas | Excel Discussion (Misc queries) | |||
Code to automatically overwrite? | Excel Programming |