Replace File

  • Thread starter Thread starter Kimberly
  • Start date Start date
K

Kimberly

I cannot determine how to write the language to overwrite
an existing file when performing "active workbook, file
save as".

I have the following code and would like for the macro to
answer "yes" for replacing the current file, but I do not
know how to write it.
ActiveWorkbook.SaveAs FileName:="C:\Temp\2003
Trial\data.xls" _
, FileFormat:=xlExcel5, Password:="",
WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Thank you for your help,
Kimberly
 
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FileName:= _
"C:\Temp\2003 Trial\data.xls" _
, FileFormat:=xlExcel5, Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True

Regards,
Tom Ogilvy
 
Back
Top