Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Baltimore, MD, Maryland, USA
    Thanked 0 Times in 0 Posts

    Saving Backup to a Different Location (OFFICE 97 SR2)

    Greetings WOPR Gurus:
    This should be a simple one to handle. I have several XL files with VBA applications that I want to have backed up each time I make changes to the code or embedded formulae. Further, I want the backup files to be on one of my hard drives rather than the share drive where the applications sit. I would be happy with a message, that would pop up each time I save the file; something like "do you want to save the backup file as well?" However, I would prefer that the users not see this message. Actually, I do NOT want the file backed after a user completes running the macros. So, how would I set it up, say using the Before Close Event, so that I am the only one that gets the message "do you want to save the backup file as well?"

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    New York, New York, Lebanon
    Thanked 1 Time in 1 Post

    Re: Saving Backup to a Different Location (OFFICE 97 SR2)


    I think you will need two workbooks, or make your own Save+Backup command.

    Either make a workbook with the BeforeClose enabled on your PC and when you deploy it the code gets deactivated.

    Or better yet have a macro attached to a Save Button on your PC that would do the saving in two locations.


    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Salt Lake City, Utah, USA
    Thanked 6 Times in 6 Posts

    Re: Saving Backup to a Different Location (OFFICE 97 SR2)

    Will something like:

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    If Application.UserName = "epic60sman" Then
    savechoice = MsgBox("Backup this file to my local hard drive?", vbYesNo)
    If savechoice = vbYes Then _
    ThisWorkbook.SaveCopyAs ("C:My documentsVBA Projects" & ThisWorkbook.Name)
    End If
    End Sub

    (untested) do it? You could add a password via an inputbox if you want more protection.
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts