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
 

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