+ Reply to Thread
Results 1 to 2 of 2

SaveAs macro: How do I specify "Replace existing file?"

  1. #1

    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. #2
    Tom Ogilvy
    Guest

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


    <[email protected]> wrote in message
    news:[email protected]...
    > 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 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