+ Reply to Thread
Results 1 to 4 of 4

Excel 2002 (10.6789.6735) SP3 Macro

  1. #1
    Two-Canucks
    Guest

    Excel 2002 (10.6789.6735) SP3 Macro

    I have a macro that makes a backup when it saves the active workbook.
    On subsequent runs of the macro, the file - Backup of ! Jagerxxx V1.0.xlk is
    NOT overwritten! As a result I do not have a backup of the most current file.

    I would like to either:
    a: overwrite the previously created Backup - or
    b: Delete the backup workbook in the macro before recreating it again.

    This is the statement I use to save the workbook:

    ActiveWorkbook.SaveAs Filename:= _
    "D:! Jagerxxx V1.0.xls", FileFormat:= _
    xlNormal, Password:="", WriteResPassword:="" _
    ,ReadOnlyRecommended:=False _
    , CreateBackup:=True

    Many Thanks
    --
    Occasionally stumped

  2. #2
    Tom Ogilvy
    Guest

    Re: Excel 2002 (10.6789.6735) SP3 Macro

    On Error Resume Next
    Kill BackupFilename
    On Error goto 0

    'now
    ActiveWorkbook.SaveAS . . .

    --
    Regards,
    Tom Ogilvy


    "Two-Canucks" <[email protected]> wrote in message
    news:[email protected]...
    > I have a macro that makes a backup when it saves the active workbook.
    > On subsequent runs of the macro, the file - Backup of ! Jagerxxx V1.0.xlk

    is
    > NOT overwritten! As a result I do not have a backup of the most current

    file.
    >
    > I would like to either:
    > a: overwrite the previously created Backup - or
    > b: Delete the backup workbook in the macro before recreating it again.
    >
    > This is the statement I use to save the workbook:
    >
    > ActiveWorkbook.SaveAs Filename:= _
    > "D:! Jagerxxx V1.0.xls", FileFormat:= _
    > xlNormal, Password:="", WriteResPassword:="" _
    > ,ReadOnlyRecommended:=False _
    > , CreateBackup:=True
    >
    > Many Thanks
    > --
    > Occasionally stumped




  3. #3
    Tom Ogilvy
    Guest

    Re: Excel 2002 (10.6789.6735) SP3 Macro

    I don't use that feature, but after doing some testing, I believe this
    option just saves the previous copy of the workbook as a back up - not the
    latest copy . This appears to be different from what you want. Perhaps you
    want to use (make sure you uncheck create backup option in the saveas
    dialog).

    s = "! Jagerxxx V1.0.xls"

    Application.DisplayAlerts = False
    ActiveWorkbook.SaveCopyAS "D:\Backup Copy of " & s
    Application.DisplayAlerts = True
    ActiveWorkbook.Save Filename:=s

    Since this isn't the first save of the workbook and you not changing names,
    use Save rather than SaveAs.

    --
    Regards,
    Tom Ogilvy


    "Two-Canucks" <[email protected]> wrote in message
    news:[email protected]...
    > I have a macro that makes a backup when it saves the active workbook.
    > On subsequent runs of the macro, the file - Backup of ! Jagerxxx V1.0.xlk

    is
    > NOT overwritten! As a result I do not have a backup of the most current

    file.
    >
    > I would like to either:
    > a: overwrite the previously created Backup - or
    > b: Delete the backup workbook in the macro before recreating it again.
    >
    > This is the statement I use to save the workbook:
    >
    > ActiveWorkbook.SaveAs Filename:= _
    > "D:! Jagerxxx V1.0.xls", FileFormat:= _
    > xlNormal, Password:="", WriteResPassword:="" _
    > ,ReadOnlyRecommended:=False _
    > , CreateBackup:=True
    >
    > Many Thanks
    > --
    > Occasionally stumped




  4. #4
    Two-Canucks
    Guest

    Re: Excel 2002 (10.6789.6735) SP3 Macro

    I used the Kill feature, have tested it, and it works as I requested.
    Thanks Tom

    --
    Occasionally stumped


    "Tom Ogilvy" wrote:

    > I don't use that feature, but after doing some testing, I believe this
    > option just saves the previous copy of the workbook as a back up - not the
    > latest copy . This appears to be different from what you want. Perhaps you
    > want to use (make sure you uncheck create backup option in the saveas
    > dialog).
    >
    > s = "! Jagerxxx V1.0.xls"
    >
    > Application.DisplayAlerts = False
    > ActiveWorkbook.SaveCopyAS "D:\Backup Copy of " & s
    > Application.DisplayAlerts = True
    > ActiveWorkbook.Save Filename:=s
    >
    > Since this isn't the first save of the workbook and you not changing names,
    > use Save rather than SaveAs.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Two-Canucks" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have a macro that makes a backup when it saves the active workbook.
    > > On subsequent runs of the macro, the file - Backup of ! Jagerxxx V1.0.xlk

    > is
    > > NOT overwritten! As a result I do not have a backup of the most current

    > file.
    > >
    > > I would like to either:
    > > a: overwrite the previously created Backup - or
    > > b: Delete the backup workbook in the macro before recreating it again.
    > >
    > > This is the statement I use to save the workbook:
    > >
    > > ActiveWorkbook.SaveAs Filename:= _
    > > "D:! Jagerxxx V1.0.xls", FileFormat:= _
    > > xlNormal, Password:="", WriteResPassword:="" _
    > > ,ReadOnlyRecommended:=False _
    > > , CreateBackup:=True
    > >
    > > Many Thanks
    > > --
    > > Occasionally stumped

    >
    >
    >


+ 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