Replace File

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
 
T

Tom Ogilvy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top