Macro code to remove the prompt "are you sure" when saving over same name

A

AlanN

Can anyone tell me what 'switches' I would need to save over the same file name without prompting the user for confirmation when run from a macro?

ActiveWorkbook.SaveAs FileName:="c:\Spreadsheets\myfile.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

TIA, AlanN
 
K

Ken Wright

Try

Application.DisplayAlerts = False

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :)
----------------------------------------------------------------------------



Can anyone tell me what 'switches' I would need to save over the same file name
without prompting the user for confirmation when run from a macro?

ActiveWorkbook.SaveAs FileName:="c:\Spreadsheets\myfile.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

TIA, AlanN
 
F

Frank Kabel

Hi
try
application.displayalerts=false
ActiveWorkbook.SaveAs FileName:="c:\Spreadsheets\myfile.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