file back-up option

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

I'm looking to see if anyone can help with the 'always
create back-up' option in Excel. I have some users that
are accidentally editing the back-up file instead of the
original file because the 'always create backup' feature
saves the backup file in the current/active subfolder.
Granted with a little more attention to detail, this can
be avoided but I was looking to see if there is any way to
change the location where the back-up files are created to
another folder to avoid this problem going forward.
Thanks.
 
Hi Steve,

Chk out the following VBA code .... I picked it up from
MSDN (April 2000 Version)... It is called as BUWYW (Back
Up While You Work) .... The article is too long to be
included here ....

I tried it and it works great ....

Rgds
Joseph

Sub BackupActiveFile()
' Quit if there's nothing open.
If Windows.Count = 0 Then Exit Sub
' Set an object variable that refers to the active file.
Dim ThisFile As Object
Set ThisFile = ActiveWindow.Parent
' Bail out if the file hasn't been saved.
If ThisFile.Path = vbNullString Then Exit Sub
' Copy it.
Dim fo As SHFILEOPSTRUCT
With fo
.wFunc = FO_COPY
.pFrom = ThisFile.FullName
.pTo = "E:\My Backups\" & ThisFile.Name
.fFlags = FOF_NOCONFIRMMKDIR + FOF_NOCONFIRMATION
End With
Call SHFileOperation(fo)
End Sub
 
thanks --- I'll give this a shot.

-----Original Message-----
Hi Steve,

Chk out the following VBA code .... I picked it up from
MSDN (April 2000 Version)... It is called as BUWYW (Back
Up While You Work) .... The article is too long to be
included here ....

I tried it and it works great ....

Rgds
Joseph

Sub BackupActiveFile()
' Quit if there's nothing open.
If Windows.Count = 0 Then Exit Sub
' Set an object variable that refers to the active file.
Dim ThisFile As Object
Set ThisFile = ActiveWindow.Parent
' Bail out if the file hasn't been saved.
If ThisFile.Path = vbNullString Then Exit Sub
' Copy it.
Dim fo As SHFILEOPSTRUCT
With fo
.wFunc = FO_COPY
.pFrom = ThisFile.FullName
.pTo = "E:\My Backups\" & ThisFile.Name
.fFlags = FOF_NOCONFIRMMKDIR + FOF_NOCONFIRMATION
End With
Call SHFileOperation(fo)
End Sub



.
 
Back
Top