ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Updating copy of Macro workbook... (https://www.excelbanter.com/excel-discussion-misc-queries/96719-updating-copy-macro-workbook.html)

have_a_cup

Updating copy of Macro workbook...
 

ok..here's my question..i've looked around, but wasn't able to track it
down..
i have a macro workbook set up on in the default xlstart
folder....unfortunately, at my job, the drive that's on isn't backed
up...so I saved a copy of the wkbk to a drive that is backed up
regularly...

is there a way to automatically update the copy when I make changes or
add macros to the one in the xlstart folder? obviously i should
remember to, but i'm guessing that's not always going to
happen...thanks in advance...


--
have_a_cup
------------------------------------------------------------------------
have_a_cup's Profile: http://www.excelforum.com/member.php...o&userid=35394
View this thread: http://www.excelforum.com/showthread...hreadid=556749


raypayette

Updating copy of Macro workbook...
 

In the ThisWorkbook moduel you could have:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
activeworkbook.SaveAs("D:...)
End Sub


--
raypayette


------------------------------------------------------------------------
raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569
View this thread: http://www.excelforum.com/showthread...hreadid=556749


Gord Dibben

Updating copy of Macro workbook...
 
A macro for you.

Sub BUandSave2()
'Saves the current file to a backup folder and the default folder
'Note that any backup is overwritten
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs FileName:="C:\Gordstuff\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

You could call it from a Before_Save sub or just place the code into the
Before_Save sub.


Gord Dibben MS Excel MVP

On Wed, 28 Jun 2006 21:32:06 -0500, have_a_cup
wrote:


ok..here's my question..i've looked around, but wasn't able to track it
down..
i have a macro workbook set up on in the default xlstart
folder....unfortunately, at my job, the drive that's on isn't backed
up...so I saved a copy of the wkbk to a drive that is backed up
regularly...

is there a way to automatically update the copy when I make changes or
add macros to the one in the xlstart folder? obviously i should
remember to, but i'm guessing that's not always going to
happen...thanks in advance...




All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com