Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Automatically Replacing existing file on save

I'm using XL97 under WinXP-pro.

I use a "Sub auto_close()" macro to save my workbook when I close it.

The following VB code does the job of overwriting the existing file, but
it does not add the file to the Most Recently used (MRU) list:

Workbooks("Actions0.xls").Save

The following VB code adds the the file to the MRU list, but it requires
manual authorization to overwrite the existing file:

ActiveWorkbook.SaveAs FileName:= _
"C:\Documents and Settings\Michael\My
Documents\__Scratch\_2005Jan\XLmenu\Actions0.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False, AddToMru:=True

The following code does NOT seem to work:
Workbooks("Actions0.xls").Save, AddToMru:=True

Can someone clue me in to the right syntax. I could not find it in any
of my reference books.

Thanks ... WindsurferLA


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Automatically Replacing existing file on save

IN the code that works, precede with

Application.DisplayAlerts = False

reset at the end.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"windsurferLA" wrote in message
...
I'm using XL97 under WinXP-pro.

I use a "Sub auto_close()" macro to save my workbook when I close it.

The following VB code does the job of overwriting the existing file, but
it does not add the file to the Most Recently used (MRU) list:

Workbooks("Actions0.xls").Save

The following VB code adds the the file to the MRU list, but it requires
manual authorization to overwrite the existing file:

ActiveWorkbook.SaveAs FileName:= _
"C:\Documents and Settings\Michael\My
Documents\__Scratch\_2005Jan\XLmenu\Actions0.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False, AddToMru:=True

The following code does NOT seem to work:
Workbooks("Actions0.xls").Save, AddToMru:=True

Can someone clue me in to the right syntax. I could not find it in any
of my reference books.

Thanks ... WindsurferLA




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Automatically Replacing existing file on save

Bob Phillips wrote:
IN the code that works, precede with

Application.DisplayAlerts = False

reset at the end.

Good Idea... Thanks .... WindsurferLA
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
Help! Replacing Existing Information with New Entries Zquip Excel Worksheet Functions 3 December 29th 08 05:30 PM
Existing file not defaulting to same location using "Save As" Daniel918 Excel Discussion (Misc queries) 1 June 1st 05 12:55 AM
can i save an existing .xls file as a .csv file using command line craigkan Excel Discussion (Misc queries) 2 February 18th 05 02:01 PM
get path - save new file - same sub-directory as existing file tegger Excel Programming 2 October 21st 03 10:45 AM
Automatically replace existing file on save ronber[_2_] Excel Programming 1 September 25th 03 10:05 PM


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

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

About Us

"It's about Microsoft Excel"