ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Replace File (https://www.excelbanter.com/excel-programming/271833-replace-file.html)

Kimberly[_2_]

Replace File
 
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


Tom Ogilvy

Replace File
 
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

"Kimberly" wrote in message
...
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





All times are GMT +1. The time now is 05:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com