Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default SaveAs macro: How do I specify "Replace existing file?"

Hello,

I have an excel macro that saves under a specific name everyday. I DO
want to replace that file when I save it.

How do I tell the SaveAs to overwrite the previous file?

Here's my code.

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

I have to use SaveAs and not Save because my macro Copies/Pastes as
value before saving under another name.

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default SaveAs macro: How do I specify "Replace existing file?"

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"C:\file.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True

--
Regards,
Tom Ogilvy


wrote in message
oups.com...
Hello,

I have an excel macro that saves under a specific name everyday. I DO
want to replace that file when I save it.

How do I tell the SaveAs to overwrite the previous file?

Here's my code.

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

I have to use SaveAs and not Save because my macro Copies/Pastes as
value before saving under another name.

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
"Find" a wildcard as a place marker and "replace" with original va Eric Excel Discussion (Misc queries) 1 January 27th 09 06:00 PM
Insert "Proper Function" into existing macro jackel[_14_] Excel Worksheet Functions 10 March 10th 08 04:00 PM
turn off the " replace file?" question when saving excel files Dave Parkes Excel Programming 1 December 16th 04 05:08 PM
within a macro how can I suppress the warning pop "A file named xxxx.xls already exists in this location. Do you want to replace it?" Pete McCosh Excel Programming 0 April 2nd 04 04:51 PM
How do you replace an existing file, saying "yes" in a macro? Chris Excel Programming 0 November 19th 03 03:25 PM


All times are GMT +1. The time now is 12:31 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"