Create a backup automatically on open

chris115

New Member
Joined
Sep 29, 2006
Messages
9
Hi,

I want to create a back up of a file I when it is first opened. This backup file needs to go in a separate folder and have the date and time concatenated to it.

I realise the code needs to go in the Workbook_Open function, but not sure how to create the backup.
I don't want to do a Save As, because I want to still work on the original. I just want a copy of how it was when first opened.

Any Ideas?

Thanks
 

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

CharlesH

Active Member
Joined
Apr 23, 2005
Messages
467
Saveas Backup

chris115,

In your WorkBook Open try this code at the begining of your code.

Code:
ActiveWorkbook.SaveCopyAs Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) & ".bak"
 

Watch MrExcel Video

Forum statistics

Threads
1,113,918
Messages
5,545,025
Members
410,647
Latest member
bernardazar
Top