Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
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
Macro Help for Excel 2002 Somewhere In Excel 2002 Excel Discussion (Misc queries) 0 August 26th 07 01:20 AM
excel 2002 macro DaveF Excel Worksheet Functions 0 June 20th 07 05:37 PM
xl2007 add columns 6789 thru 10302 Jimmy Excel Discussion (Misc queries) 3 June 14th 07 11:15 AM
HOW DO I CHANGE THE FORMAT OF A SS# FROM 123-45-6789 TO 123456789 doug@sunwest Excel Worksheet Functions 4 May 6th 06 01:57 AM
Excel 2002 and VB Macro adavisRSC Excel Programming 1 May 10th 05 04:09 PM


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

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

About Us

"It's about Microsoft Excel"