Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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" wrote in message ... 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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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" wrote in message ... 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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Help for Excel 2002 | Excel Discussion (Misc queries) | |||
excel 2002 macro | Excel Worksheet Functions | |||
xl2007 add columns 6789 thru 10302 | Excel Discussion (Misc queries) | |||
HOW DO I CHANGE THE FORMAT OF A SS# FROM 123-45-6789 TO 123456789 | Excel Worksheet Functions | |||
Excel 2002 and VB Macro | Excel Programming |