ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Replace file without being prompted to save (https://www.excelbanter.com/excel-programming/411526-replace-file-without-being-prompted-save.html)

SJW_OST[_2_]

Replace file without being prompted to save
 
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.

Jim Thomlinson

Replace file without being prompted to save
 
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
--
HTH...

Jim Thomlinson


"SJW_OST" wrote:

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.


SJW_OST[_2_]

Replace file without being prompted to save
 
You guys are AWSOME!!!
Thank you, that works perfectly!

"Jim Thomlinson" wrote:

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
--
HTH...

Jim Thomlinson


"SJW_OST" wrote:

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.



All times are GMT +1. The time now is 07:18 PM.

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