Thread: Save As Macro
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Save As Macro

Hi,

Try this

Application.DisplayAlerts = False

ActiveWorkbook.SaveAs Filename:="c:\filename.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Max2073" wrote:

I have created a macro that I use weekly. The macro names and saves the
spreadsheet.

Currently, when saving the spreadsheet I am asked "A file name
€˜c:\filename.xls already exists in this location. Do you want to replace
it?"

Is there a way that I can amend the macro to automatically answer YES.

ActiveWorkbook.SaveAs Filename:="c:\filename.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Thanks