Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Help with Save As in a macro.

I am trying to set up a macro to save a back up of a file before
making changes to the file. When I try to back up the file by saving
it over the existing file I get a prompt asking me if I want to
overwrite the old file, wich I do. But I want the macro to do this
automaticly without promting the user. Is there any way to do this?
Is there a switch to automaticly overwrite an existing file?

Here is a copy of the code so far...

ChDir "Z:\DIV4\Dept12\Dept12 Customer Service\Backup"
ActiveWorkbook.SaveAs Filename:= _
"Z:\DIV4\Dept12\Dept12 Customer Service\Backup\!Dept12
CustServ Data Center.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ChDir "Z:\DIV4\Dept12\Dept12 Customer Service"
ActiveWorkbook.SaveAs Filename:= _
"Z:\DIV4\Dept12\Dept12 Customer Service\!Dept12 CustServ Data
Center.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False


Thanks
Steve M.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Help with Save As in a macro.

Hi

Before the SaveAs like add this

Application.DisplayAlerts = False
And after it
Application.DisplayAlerts = true


--
Regards Ron de Bruin
http://www.rondebruin.nl


"SMonczka" wrote in message om...
I am trying to set up a macro to save a back up of a file before
making changes to the file. When I try to back up the file by saving
it over the existing file I get a prompt asking me if I want to
overwrite the old file, wich I do. But I want the macro to do this
automaticly without promting the user. Is there any way to do this?
Is there a switch to automaticly overwrite an existing file?

Here is a copy of the code so far...

ChDir "Z:\DIV4\Dept12\Dept12 Customer Service\Backup"
ActiveWorkbook.SaveAs Filename:= _
"Z:\DIV4\Dept12\Dept12 Customer Service\Backup\!Dept12
CustServ Data Center.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ChDir "Z:\DIV4\Dept12\Dept12 Customer Service"
ActiveWorkbook.SaveAs Filename:= _
"Z:\DIV4\Dept12\Dept12 Customer Service\!Dept12 CustServ Data
Center.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False


Thanks
Steve M.



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 to Insert Current Date into cell - Macro to "Save As" Guy[_2_] Excel Worksheet Functions 4 December 12th 08 08:20 PM
macro to save as frageo64 Excel Discussion (Misc queries) 2 November 13th 07 06:57 AM
MACRO SAVE HELP DP7 Excel Worksheet Functions 2 October 17th 07 08:01 PM
Macro to Save without the Save Message Ellen G Excel Discussion (Misc queries) 4 February 23rd 07 08:52 PM
Prompted to save changes after macro save - why? Izar Arcturus Excel Programming 2 December 10th 03 09:27 PM


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