#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default Save As Macro

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Save As Macro

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
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro save puiuluipui Excel Discussion (Misc queries) 8 January 5th 10 11:31 AM
Macro to Insert Current Date into cell - Macro to "Save As" Guy[_2_] Excel Worksheet Functions 4 December 12th 08 08:20 PM
Macro (SAVE AS) Tom Excel Discussion (Misc queries) 1 September 26th 07 02:41 PM
Macro to Save without the Save Message Ellen G Excel Discussion (Misc queries) 4 February 23rd 07 08:52 PM
Save as Macro MikeD1224 Excel Discussion (Misc queries) 1 February 16th 07 11:08 PM


All times are GMT +1. The time now is 04:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"