Save file without prompting

A

andym

Can you tell me how to write the VBA code or amend the code below t
save and overwrite the path of an existing file without excel promptin
the user to click yes to overwrite that file.

Thanks


ActiveWorkbook.SaveAs Filename:="C:\TEMP\file.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=Fals
 
T

Tom Ogilvy

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\TEMP\file.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True

or

On error resume next
Kill "C:\TEMP\file.xls"
On Error goto 0
ActiveWorkbook.SaveAs Filename:="C:\TEMP\file.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
 
Top