Updating copy of Macro workbook...

  • Thread starter Thread starter have_a_cup
  • Start date Start date
H

have_a_cup

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...
 
In the ThisWorkbook moduel you could have:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
activeworkbook.SaveAs("D:...)
End Sub
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top