Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to save a copy of a spreadsheet in a different location, after I
update it. I put code in the BeforeClose event, so it saves the file in the desired location. The problem I have is it saves the BeforeClose event also. Is there anyway to make a backup copy of the file and not include the code in the backup copy? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is a backup macro I use.
Sub Backup() 'kept in personal.xls & assigned to toolbar button On Error GoTo BackupFile MkDir CurDir & "\Backup" BackupFile: With ActiveWorkbook MyWB = .Path & "\BACKUP\" & .Name .SaveCopyAs MyWB .Save End With End Sub "Mike" wrote in message news:5o1cb.556043$YN5.374683@sccrnsc01... I want to save a copy of a spreadsheet in a different location, after I update it. I put code in the BeforeClose event, so it saves the file in the desired location. The problem I have is it saves the BeforeClose event also. Is there anyway to make a backup copy of the file and not include the code in the backup copy? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm sure the is an easier way, but I had the same problem
and came up with this solution. Copy each of the worksheets to a new workbook and then save that workbook as your backup. This will remove ALL of your code, so if you want to keep some, then you'll have to find another way. -----Original Message----- I want to save a copy of a spreadsheet in a different location, after I update it. I put code in the BeforeClose event, so it saves the file in the desired location. The problem I have is it saves the BeforeClose event also. Is there anyway to make a backup copy of the file and not include the code in the backup copy? . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Mike" wrote in message news:5o1cb.556043$YN5.374683@sccrnsc01... I want to save a copy of a spreadsheet in a different location, after I update it. I put code in the BeforeClose event, so it saves the file in the desired location. The problem I have is it saves the BeforeClose event also. Is there anyway to make a backup copy of the file and not include the code in the backup copy? You can probably work around this by reopening the backup copy after it has been saved, and then using sendkeys to activate the VBE and delete the code. Bit tricky though. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Man Hour Savings | Excel Discussion (Misc queries) | |||
beforeclose placement | Excel Discussion (Misc queries) | |||
Trying to get annual savings | Excel Discussion (Misc queries) | |||
PASSWORD PROTECT BEFORECLOSE | Excel Discussion (Misc queries) | |||
Excel - BeforeClose Problem... | Excel Programming |