View Single Post
  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

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