+ Reply to Thread
Results 1 to 7 of 7

Creating a back up copy.

  1. #1
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Creating a back up copy.

    I am trying to create a back up copy of a data file and honestly do not know how to do it. Both the data file and the new backup file will always have the same name and are also going to be in the same directory on the hard drive.

    Any help would be greatly appreciated.


    Also, one more thing (this might be a bit more complex so it does not need to be addressed). I would have a button used to do this ‘Back Up’ function but it would be really cool to have a checkbox (which I have) for ‘Auto-Back Up’ I have another button that will just close save and close the program but I don’t know how to run a test INSIDE a macro that check to see if a true or false exists and if true do this. Otherwise skip this portion of the macro.

    Again and always thank you very much for your help,

    Ken

  2. #2
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651
    Desperate bump please. Really need to get some help with this one.

  3. #3
    Tom Ogilvy
    Guest

    Re: Creating a back up copy.

    Use the SaveCopyAs method of the workbook.

    If <condition> = True then

    --
    Regards,
    Tom Ogilvy


    "sungen99" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I am trying to create a back up copy of a data file and honestly do not
    > know how to do it. Both the data file and the new backup file will
    > always have the same name and are also going to be in the same
    > directory on the hard drive.
    >
    > Any help would be greatly appreciated.
    >
    >
    > Also, one more thing (this might be a bit more complex so it does not
    > need to be addressed). I would have a button used to do this 'Back Up'
    > function but it would be really cool to have a checkbox (which I have)
    > for 'Auto-Back Up' I have another button that will just close save and
    > close the program but I don't know how to run a test INSIDE a macro
    > that check to see if a true or false exists and if true do this.
    > Otherwise skip this portion of the macro.
    >
    > Again and always thank you very much for your help,
    >
    > Ken
    >
    >
    > --
    > sungen99
    > ------------------------------------------------------------------------
    > sungen99's Profile:

    http://www.excelforum.com/member.php...fo&userid=9144
    > View this thread: http://www.excelforum.com/showthread...hreadid=475370
    >




  4. #4
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651
    Ok I get the conditional now but I’m still having problems with the backup thing. I see all the examples are backing up the active workbook. This is not the case with my situation. The file I need to back up is located here:
    C:\Documents and Settings\Dan Sharron\Mrs\Admin\Execution\Mrs 2005 Data-Ver1 1.xls
    I would like to just make a copy of this file and call it:
    C:\Documents and Settings\Dan Sharron\Mrs\Admin\Execution\Mrs 2005 Data-Ver1 1 Backup.xls

  5. #5
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651
    Desperate bump please. Really need to get some help with this one.

  6. #6
    Tom Ogilvy
    Guest

    Re: Creating a back up copy.



    s1 = "C:\Documents and Settings\Dan Sharron" & _
    "\Mrs\Admin\Execution\Mrs 2005 Data-Ver1 1.xls"
    s2 = "C:\Documents and Settings\Dan Sharron" & _
    "\Mrs\Admin\Execution\Mrs 2005 Data-Ver1 1 Backup.xls

    On error resume next
    Kill s2
    filecopy s1, s2

    Remarks

    If you try to use the FileCopy statement on a currently open file, an error
    occurs.

    --

    Regards,

    Tom Ogilvy




    "sungen99" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Ok I get the conditional now but I'm still having problems with the
    > backup thing. I see all the examples are backing up the active
    > workbook. This is not the case with my situation. The file I need to
    > back up is located here:
    > C:\Documents and Settings\Dan Sharron\Mrs\Admin\Execution\Mrs 2005
    > Data-Ver1 1.xls
    > I would like to just make a copy of this file and call it:
    > C:\Documents and Settings\Dan Sharron\Mrs\Admin\Execution\Mrs 2005
    > Data-Ver1 1 Backup.xls
    >
    >
    > --
    > sungen99
    > ------------------------------------------------------------------------
    > sungen99's Profile:

    http://www.excelforum.com/member.php...fo&userid=9144
    > View this thread: http://www.excelforum.com/showthread...hreadid=475370
    >




  7. #7
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651
    Ahhhhhh. That worked!

    Thanks very much for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1