A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Setting up and Configuration
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

can I create backup file in separate folder from the original?



 
 
Thread Tools Display Modes
  #1  
Old January 15th, 2008, 11:59 AM posted to microsoft.public.excel.setup
MCC Wong
external usenet poster
 
Posts: 1
Default can I create backup file in separate folder from the original?

Is is possible to automatically create a backup file once we update an excel
file in a separate folder from the folder with the original excel file. The
reason is that we are afraid that someone might delete the folder
accidentally and lost all the both the original file and the backup file.

We are using Microsoft Excel 2003
  #2  
Old January 15th, 2008, 07:57 PM posted to microsoft.public.excel.setup
Gord Dibben
external usenet poster
 
Posts: 20,252
Default can I create backup file in separate folder from the original?

Only through VBA code which makes a backup copy of the file in another folder of
your choice when saved.

Private Sub Workbook_BeforeSave(ByVal _
SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:="C:\Gordstuff\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

On the other hand, why don't you just regularly make a backup of the folder?

You should be doing that with all your data files and folders as a routine.


Gord Dibben MS Excel MVP

On Tue, 15 Jan 2008 03:59:00 -0800, MCC Wong MCC
wrote:

Is is possible to automatically create a backup file once we update an excel
file in a separate folder from the folder with the original excel file. The
reason is that we are afraid that someone might delete the folder
accidentally and lost all the both the original file and the backup file.

We are using Microsoft Excel 2003


  #3  
Old January 16th, 2008, 12:16 PM posted to microsoft.public.excel.setup
MCC Wong[_2_]
external usenet poster
 
Posts: 3
Default can I create backup file in separate folder from the original?

Thanks Dibben,

I've tried the VBA code, but not successful. Since I'm not familiar with
using VBA code or writing macro, can you teach me how to do it??

I have created a shared electronic bank book namely 'HSBC.xls' in J drive
and when I save this file, I would like to make a backup copy in C drive
namely 'Backup HSBC', but I don't know exactly how to write VBA code.

Should I use the macro function or the Visual Basic Editor under Tools??
Please teach me how to write the macro or VBA code!!

I've tried the following as suggested but won't work:

Sub HSBC (ByValSaveASUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs "C:\Backup HSBC.xls" & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

What have I done wrong?? please advice!!

MCC

"Gord Dibben" wrote:

Only through VBA code which makes a backup copy of the file in another folder of
your choice when saved.

Private Sub Workbook_BeforeSave(ByVal _
SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:="C:\Gordstuff\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

On the other hand, why don't you just regularly make a backup of the folder?

You should be doing that with all your data files and folders as a routine.


Gord Dibben MS Excel MVP

On Tue, 15 Jan 2008 03:59:00 -0800, MCC Wong MCC
wrote:

Is is possible to automatically create a backup file once we update an excel
file in a separate folder from the folder with the original excel file. The
reason is that we are afraid that someone might delete the folder
accidentally and lost all the both the original file and the backup file.

We are using Microsoft Excel 2003



  #4  
Old January 16th, 2008, 01:46 PM posted to microsoft.public.excel.setup
CLR
external usenet poster
 
Posts: 1,638
Default can I create backup file in separate folder from the original?

If you are working for a Company, with a MIS department, they usually have a
regular schedule of making backups of all files. Check with them, and
negotiate your needs.

Vaya con Dios,
Chuck, CABGx3



"MCC Wong" wrote:

Is is possible to automatically create a backup file once we update an excel
file in a separate folder from the folder with the original excel file. The
reason is that we are afraid that someone might delete the folder
accidentally and lost all the both the original file and the backup file.

We are using Microsoft Excel 2003

  #5  
Old January 17th, 2008, 12:11 AM posted to microsoft.public.excel.setup
Gord Dibben
external usenet poster
 
Posts: 20,252
Default can I create backup file in separate folder from the original?

You have made too many changes to the code I posted.

Try this one and do not make any more changes.

Private Sub Workbook_BeforeSave (ByValSaveASUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs "C:\Backup HSBC\" & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

Copy this code as is then in top left corner of Excel Menu bar left of "File"
right-click on the Excel Icon and "View Code"

Paste the code into that module.

Alt + q to return to Excel window. Save your workbook.

Go look in BackupHSBC folder.


Gord

On Wed, 16 Jan 2008 04:16:00 -0800, MCC Wong
wrote:

Thanks Dibben,

I've tried the VBA code, but not successful. Since I'm not familiar with
using VBA code or writing macro, can you teach me how to do it??

I have created a shared electronic bank book namely 'HSBC.xls' in J drive
and when I save this file, I would like to make a backup copy in C drive
namely 'Backup HSBC', but I don't know exactly how to write VBA code.

Should I use the macro function or the Visual Basic Editor under Tools??
Please teach me how to write the macro or VBA code!!

I've tried the following as suggested but won't work:

Sub HSBC (ByValSaveASUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs "C:\Backup HSBC.xls" & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

What have I done wrong?? please advice!!

MCC

"Gord Dibben" wrote:

Only through VBA code which makes a backup copy of the file in another folder of
your choice when saved.

Private Sub Workbook_BeforeSave(ByVal _
SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:="C:\Gordstuff\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

On the other hand, why don't you just regularly make a backup of the folder?

You should be doing that with all your data files and folders as a routine.


Gord Dibben MS Excel MVP

On Tue, 15 Jan 2008 03:59:00 -0800, MCC Wong MCC
wrote:

Is is possible to automatically create a backup file once we update an excel
file in a separate folder from the folder with the original excel file. The
reason is that we are afraid that someone might delete the folder
accidentally and lost all the both the original file and the backup file.

We are using Microsoft Excel 2003




  #6  
Old January 18th, 2008, 06:11 AM posted to microsoft.public.excel.setup
MCC Wong[_2_]
external usenet poster
 
Posts: 3
Default can I create backup file in separate folder from the original?

Dear Dibben,

I've just copied your code but the feedback shows the following message:
"Complie error:
Procedure declaration does not match description of event or procedure
having the same name."
and the first code "Private Sub Workbook_BeforeSave (ByValSaveASUI As
Boolean, Cancel As Boolean)" is being highlighted.

Please advice.

MCC

"Gord Dibben" wrote:

You have made too many changes to the code I posted.

Try this one and do not make any more changes.

Private Sub Workbook_BeforeSave (ByValSaveASUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs "C:\Backup HSBC\" & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

Copy this code as is then in top left corner of Excel Menu bar left of "File"
right-click on the Excel Icon and "View Code"

Paste the code into that module.

Alt + q to return to Excel window. Save your workbook.

Go look in BackupHSBC folder.


Gord

On Wed, 16 Jan 2008 04:16:00 -0800, MCC Wong
wrote:

Thanks Dibben,

I've tried the VBA code, but not successful. Since I'm not familiar with
using VBA code or writing macro, can you teach me how to do it??

I have created a shared electronic bank book namely 'HSBC.xls' in J drive
and when I save this file, I would like to make a backup copy in C drive
namely 'Backup HSBC', but I don't know exactly how to write VBA code.

Should I use the macro function or the Visual Basic Editor under Tools??
Please teach me how to write the macro or VBA code!!

I've tried the following as suggested but won't work:

Sub HSBC (ByValSaveASUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs "C:\Backup HSBC.xls" & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

What have I done wrong?? please advice!!

MCC

"Gord Dibben" wrote:

Only through VBA code which makes a backup copy of the file in another folder of
your choice when saved.

Private Sub Workbook_BeforeSave(ByVal _
SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:="C:\Gordstuff\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

On the other hand, why don't you just regularly make a backup of the folder?

You should be doing that with all your data files and folders as a routine.


Gord Dibben MS Excel MVP

On Tue, 15 Jan 2008 03:59:00 -0800, MCC Wong MCC
wrote:

Is is possible to automatically create a backup file once we update an excel
file in a separate folder from the folder with the original excel file. The
reason is that we are afraid that someone might delete the folder
accidentally and lost all the both the original file and the backup file.

We are using Microsoft Excel 2003




  #7  
Old January 18th, 2008, 03:18 PM posted to microsoft.public.excel.setup
Dave Peterson
external usenet poster
 
Posts: 19,791
Default can I create backup file in separate folder from the original?

You changed Gord's original code:

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

ByVal SaveAsUi are two separate words.

MCC Wong wrote:

Dear Dibben,

I've just copied your code but the feedback shows the following message:
"Complie error:
Procedure declaration does not match description of event or procedure
having the same name."
and the first code "Private Sub Workbook_BeforeSave (ByValSaveASUI As
Boolean, Cancel As Boolean)" is being highlighted.

Please advice.

MCC

"Gord Dibben" wrote:

You have made too many changes to the code I posted.

Try this one and do not make any more changes.

Private Sub Workbook_BeforeSave (ByValSaveASUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs "C:\Backup HSBC\" & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

Copy this code as is then in top left corner of Excel Menu bar left of "File"
right-click on the Excel Icon and "View Code"

Paste the code into that module.

Alt + q to return to Excel window. Save your workbook.

Go look in BackupHSBC folder.


Gord

On Wed, 16 Jan 2008 04:16:00 -0800, MCC Wong
wrote:

Thanks Dibben,

I've tried the VBA code, but not successful. Since I'm not familiar with
using VBA code or writing macro, can you teach me how to do it??

I have created a shared electronic bank book namely 'HSBC.xls' in J drive
and when I save this file, I would like to make a backup copy in C drive
namely 'Backup HSBC', but I don't know exactly how to write VBA code.

Should I use the macro function or the Visual Basic Editor under Tools??
Please teach me how to write the macro or VBA code!!

I've tried the following as suggested but won't work:

Sub HSBC (ByValSaveASUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs "C:\Backup HSBC.xls" & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

What have I done wrong?? please advice!!

MCC

"Gord Dibben" wrote:

Only through VBA code which makes a backup copy of the file in another folder of
your choice when saved.

Private Sub Workbook_BeforeSave(ByVal _
SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:="C:\Gordstuff\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

On the other hand, why don't you just regularly make a backup of the folder?

You should be doing that with all your data files and folders as a routine.


Gord Dibben MS Excel MVP

On Tue, 15 Jan 2008 03:59:00 -0800, MCC Wong MCC
wrote:

Is is possible to automatically create a backup file once we update an excel
file in a separate folder from the folder with the original excel file. The
reason is that we are afraid that someone might delete the folder
accidentally and lost all the both the original file and the backup file.

We are using Microsoft Excel 2003





--

Dave Peterson
  #8  
Old January 19th, 2008, 01:03 AM posted to microsoft.public.excel.setup
Gord Dibben
external usenet poster
 
Posts: 20,252
Default can I create backup file in separate folder from the original?

I think OP is typing, rather than just copy/pasting.

On Fri, 18 Jan 2008 09:18:06 -0600, Dave Peterson
wrote:

You changed Gord's original code:

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

ByVal SaveAsUi are two separate words.

MCC Wong wrote:

Dear Dibben,

I've just copied your code but the feedback shows the following message:
"Complie error:
Procedure declaration does not match description of event or procedure
having the same name."
and the first code "Private Sub Workbook_BeforeSave (ByValSaveASUI As
Boolean, Cancel As Boolean)" is being highlighted.

Please advice.

MCC

"Gord Dibben" wrote:

You have made too many changes to the code I posted.

Try this one and do not make any more changes.

Private Sub Workbook_BeforeSave (ByValSaveASUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs "C:\Backup HSBC\" & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

Copy this code as is then in top left corner of Excel Menu bar left of "File"
right-click on the Excel Icon and "View Code"

Paste the code into that module.

Alt + q to return to Excel window. Save your workbook.

Go look in BackupHSBC folder.


Gord

On Wed, 16 Jan 2008 04:16:00 -0800, MCC Wong
wrote:

Thanks Dibben,

I've tried the VBA code, but not successful. Since I'm not familiar with
using VBA code or writing macro, can you teach me how to do it??

I have created a shared electronic bank book namely 'HSBC.xls' in J drive
and when I save this file, I would like to make a backup copy in C drive
namely 'Backup HSBC', but I don't know exactly how to write VBA code.

Should I use the macro function or the Visual Basic Editor under Tools??
Please teach me how to write the macro or VBA code!!

I've tried the following as suggested but won't work:

Sub HSBC (ByValSaveASUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs "C:\Backup HSBC.xls" & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

What have I done wrong?? please advice!!

MCC

"Gord Dibben" wrote:

Only through VBA code which makes a backup copy of the file in another folder of
your choice when saved.

Private Sub Workbook_BeforeSave(ByVal _
SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:="C:\Gordstuff\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

On the other hand, why don't you just regularly make a backup of the folder?

You should be doing that with all your data files and folders as a routine.


Gord Dibben MS Excel MVP

On Tue, 15 Jan 2008 03:59:00 -0800, MCC Wong MCC
wrote:

Is is possible to automatically create a backup file once we update an excel
file in a separate folder from the folder with the original excel file. The
reason is that we are afraid that someone might delete the folder
accidentally and lost all the both the original file and the backup file.

We are using Microsoft Excel 2003





  #9  
Old January 19th, 2008, 01:05 AM posted to microsoft.public.excel.setup
Dave Peterson
external usenet poster
 
Posts: 19,791
Default can I create backup file in separate folder from the original?

If it's more than 3 characters, that's usually a mistake! vbg

Gord Dibben wrote:

I think OP is typing, rather than just copy/pasting.

On Fri, 18 Jan 2008 09:18:06 -0600, Dave Peterson
wrote:

You changed Gord's original code:

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

ByVal SaveAsUi are two separate words.

MCC Wong wrote:

Dear Dibben,

I've just copied your code but the feedback shows the following message:
"Complie error:
Procedure declaration does not match description of event or procedure
having the same name."
and the first code "Private Sub Workbook_BeforeSave (ByValSaveASUI As
Boolean, Cancel As Boolean)" is being highlighted.

Please advice.

MCC

"Gord Dibben" wrote:

You have made too many changes to the code I posted.

Try this one and do not make any more changes.

Private Sub Workbook_BeforeSave (ByValSaveASUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs "C:\Backup HSBC\" & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

Copy this code as is then in top left corner of Excel Menu bar left of "File"
right-click on the Excel Icon and "View Code"

Paste the code into that module.

Alt + q to return to Excel window. Save your workbook.

Go look in BackupHSBC folder.


Gord

On Wed, 16 Jan 2008 04:16:00 -0800, MCC Wong
wrote:

Thanks Dibben,

I've tried the VBA code, but not successful. Since I'm not familiar with
using VBA code or writing macro, can you teach me how to do it??

I have created a shared electronic bank book namely 'HSBC.xls' in J drive
and when I save this file, I would like to make a backup copy in C drive
namely 'Backup HSBC', but I don't know exactly how to write VBA code.

Should I use the macro function or the Visual Basic Editor under Tools??
Please teach me how to write the macro or VBA code!!

I've tried the following as suggested but won't work:

Sub HSBC (ByValSaveASUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs "C:\Backup HSBC.xls" & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

What have I done wrong?? please advice!!

MCC

"Gord Dibben" wrote:

Only through VBA code which makes a backup copy of the file in another folder of
your choice when saved.

Private Sub Workbook_BeforeSave(ByVal _
SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:="C:\Gordstuff\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

On the other hand, why don't you just regularly make a backup of the folder?

You should be doing that with all your data files and folders as a routine.


Gord Dibben MS Excel MVP

On Tue, 15 Jan 2008 03:59:00 -0800, MCC Wong MCC
wrote:

Is is possible to automatically create a backup file once we update an excel
file in a separate folder from the folder with the original excel file. The
reason is that we are afraid that someone might delete the folder
accidentally and lost all the both the original file and the backup file.

We are using Microsoft Excel 2003





--

Dave Peterson
  #10  
Old January 19th, 2008, 01:06 AM posted to microsoft.public.excel.setup
Gord Dibben
external usenet poster
 
Posts: 20,252
Default can I create backup file in separate folder from the original?

Although I must admit, I compounded the error by copying some of his first
incorrect attempt at making changes by leaving the "ByValSaveASUI" in my second
posting.


Gord

On Fri, 18 Jan 2008 17:03:05 -0800, Gord Dibben gorddibbATshawDOTca wrote:

I think OP is typing, rather than just copy/pasting.

On Fri, 18 Jan 2008 09:18:06 -0600, Dave Peterson
wrote:

You changed Gord's original code:

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

ByVal SaveAsUi are two separate words.

MCC Wong wrote:

Dear Dibben,

I've just copied your code but the feedback shows the following message:
"Complie error:
Procedure declaration does not match description of event or procedure
having the same name."
and the first code "Private Sub Workbook_BeforeSave (ByValSaveASUI As
Boolean, Cancel As Boolean)" is being highlighted.

Please advice.

MCC

"Gord Dibben" wrote:

You have made too many changes to the code I posted.

Try this one and do not make any more changes.

Private Sub Workbook_BeforeSave (ByValSaveASUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs "C:\Backup HSBC\" & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

Copy this code as is then in top left corner of Excel Menu bar left of "File"
right-click on the Excel Icon and "View Code"

Paste the code into that module.

Alt + q to return to Excel window. Save your workbook.

Go look in BackupHSBC folder.


Gord

On Wed, 16 Jan 2008 04:16:00 -0800, MCC Wong
wrote:

Thanks Dibben,

I've tried the VBA code, but not successful. Since I'm not familiar with
using VBA code or writing macro, can you teach me how to do it??

I have created a shared electronic bank book namely 'HSBC.xls' in J drive
and when I save this file, I would like to make a backup copy in C drive
namely 'Backup HSBC', but I don't know exactly how to write VBA code.

Should I use the macro function or the Visual Basic Editor under Tools??
Please teach me how to write the macro or VBA code!!

I've tried the following as suggested but won't work:

Sub HSBC (ByValSaveASUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs "C:\Backup HSBC.xls" & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

What have I done wrong?? please advice!!

MCC

"Gord Dibben" wrote:

Only through VBA code which makes a backup copy of the file in another folder of
your choice when saved.

Private Sub Workbook_BeforeSave(ByVal _
SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:="C:\Gordstuff\" & _
ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub

On the other hand, why don't you just regularly make a backup of the folder?

You should be doing that with all your data files and folders as a routine.


Gord Dibben MS Excel MVP

On Tue, 15 Jan 2008 03:59:00 -0800, MCC Wong MCC
wrote:

Is is possible to automatically create a backup file once we update an excel
file in a separate folder from the folder with the original excel file. The
reason is that we are afraid that someone might delete the folder
accidentally and lost all the both the original file and the backup file.

We are using Microsoft Excel 2003





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:05 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.