Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Accept Overwrite Automatically

Hi,

I have a file that I want to save in 2 different places so I always have an
up to date backup copy. I also want to be able to modif y either copy and
have the most current file in both places. Using the code below I get a
prompt asking if I want to overwrite the current file. Is there a way to
Accept the Overwrite Automatically?

Thanks,

Mike

ChDir "H:\"
ActiveWorkbook.SaveAs Filename:="H:\Hours.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
ChDir "H:\SX56 My Documents\Excel"
ActiveWorkbook.SaveAs Filename:="H:\SX56 My Documents\Excel\Hours.xls",
_
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Accept Overwrite Automatically

Application.DisplayAlerts = False
ChDir "H:\"
ActiveWorkbook.SaveAs Filename:="H:\Hours.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
ChDir "H:\SX56 My Documents\Excel"
ActiveWorkbook.SaveAs Filename:="H:\SX56 My Documents\Excel\Hours.xls",
_
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True

If you don't want to change the name of the open workbook, look at
SaveCopyAs

--
Regards,
Tom Ogilvy


"Reed" wrote in message
...
Hi,

I have a file that I want to save in 2 different places so I always have

an
up to date backup copy. I also want to be able to modif y either copy and
have the most current file in both places. Using the code below I get a
prompt asking if I want to overwrite the current file. Is there a way to
Accept the Overwrite Automatically?

Thanks,

Mike

ChDir "H:\"
ActiveWorkbook.SaveAs Filename:="H:\Hours.xls", FileFormat:=xlNormal,

_
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
ChDir "H:\SX56 My Documents\Excel"
ActiveWorkbook.SaveAs Filename:="H:\SX56 My

Documents\Excel\Hours.xls",
_
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False




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
Save As / Overwrite Brent E Excel Discussion (Misc queries) 4 October 23rd 08 08:19 PM
VBA to automatically test for file, update, overwrite Brent E Excel Discussion (Misc queries) 3 October 22nd 08 11:00 PM
Overwrite Changes when saving Shari Kolbo Charts and Charting in Excel 1 January 11th 06 04:16 AM
Q: overwrite during saveas JIM.H. Excel Discussion (Misc queries) 1 January 5th 05 07:27 PM
Code to automatically overwrite? andycharger[_9_] Excel Programming 2 February 10th 04 09:44 AM


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