+ Reply to Thread
Results 1 to 3 of 3

How can we back up a permanant copy of an excel file automaticaly

  1. #1
    Gita
    Guest

    How can we back up a permanant copy of an excel file automaticaly

    How can we back up an excel file in our hard disk without using SAVE AS
    command in our hard disk each time we close the file.
    I want to have a update copy of the excel file on my hard disk without
    others know that this file is being backuped up some where in the hard disk
    while closing it.

    THANK YOU

  2. #2
    FSt1
    Guest

    RE: How can we back up a permanant copy of an excel file automaticaly

    hi
    end the workbook before close event....

    Private Sub Workbook_BeforeClose(Cancel As Boolean)

    ActiveWorkbook.SaveAs Filename:="YourfullFilePathAndName", _
    FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
    ReadOnlyRecommended:=False, CreateBackup:=False

    End Sub

    regards

    FSt1

    "Gita" wrote:

    > How can we back up an excel file in our hard disk without using SAVE AS
    > command in our hard disk each time we close the file.
    > I want to have a update copy of the excel file on my hard disk without
    > others know that this file is being backuped up some where in the hard disk
    > while closing it.
    >
    > THANK YOU


  3. #3
    Dave Peterson
    Guest

    Re: How can we back up a permanant copy of an excel file automaticaly

    I would have used the workbook_beforesave event.

    Option Explicit
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

    On Error Resume Next
    MkDir "C:\mybackups"
    Me.SaveCopyAs Filename:="c:\mybackups\mynamehere.xls"
    On Error GoTo 0

    End Sub


    This code goes under the ThisWorkbook module.

    And it overwrites the previous backup (if it exists) each time you save your
    file.

    If you're new to macros, you may want to read David McRitchie's intro at:
    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    Gita wrote:
    >
    > How can we back up an excel file in our hard disk without using SAVE AS
    > command in our hard disk each time we close the file.
    > I want to have a update copy of the excel file on my hard disk without
    > others know that this file is being backuped up some where in the hard disk
    > while closing it.
    >
    > THANK YOU


    --

    Dave Peterson

+ 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