How do i save backup copy in a different folder

M

mekraj

When i am saving a file by selecting "Always create backup", backup file is
saved in the same folder, how do i save this backup file in a different
folder. - Microsoft Excel 2000
 
B

Bob Phillips

Try using the SaveAsCopy method instead.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
D

Don Guillett

Here is one I use to backup to the current directory\backup

Sub Backup() 'kept in personal.xls & assigned to toolbar button
On Error GoTo BackupFile
MkDir CurDir & "\Backup"
BackupFile:
With ActiveWorkbook
MyWB = .Path & "\BACKUP\" & .Name
.SaveCopyAs MyWB
.Save
End With
End Sub
 
G

Gord Dibben

RP

This would require VBA code as Bob points out with the savecopyas method.

Sub BUandSave()
'Saves the current file to a backup folder and the default folder
'Note that any backup is overwritten
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs FileName:="E:\GordStuff\Backup\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

You could use a BeforeSave Sub in Thisworkbook module.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
BUandSave
End Sub


Gord Dibben Excel MVP
 
Top