From: Max2073 on 9 Apr 2010 08:01 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
From: Dave Peterson on 9 Apr 2010 08:15 Application.displayalerts = false 'your code to save application.displayalerts = true 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 -- Dave Peterson
From: Mike H on 9 Apr 2010 08:17 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
|
Pages: 1 Prev: Include CDF to workbook Next: COUNT BLANK AND ZERO AS THE SAME THING |