Replace file without being prompted to save

S

SJW_OST

I use this code to save over a file with new info;

ActiveWorkbook.SaveAs Filename:= _
"H:\Shortcuts&Links\M Y P R O J E C T
S\NationalSummary\DPR_National_Summary_Daily.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

I get prompted that the file already exists and do I want to replace the
file by saving anyway. I do want to save anyway each and every time. What
code can I include to automatically save and replace the file without being
prompted?

Your help is greatly appreciated.
 
J

Jim Thomlinson

You want to temporarily suspend alerts as follows...

Application.displayalerts = false

ActiveWorkbook.SaveAs Filename:= _
"H:\Shortcuts&Links\M Y P R O J E C T
S\NationalSummary\DPR_National_Summary_Daily.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Application.displayAlerts = true
 

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

Top