+ Reply to Thread
Results 1 to 3 of 3

Automatically Replacing existing file on save

  1. #1
    windsurferLA
    Guest

    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. #2
    Bob Phillips
    Guest

    Re: 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" <buczacz@yahoo.com> wrote in message
    news:k4mdnR_58rMzxpnfRVn-qA@comcast.com...
    > 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. #3
    windsurferLA
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1