Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving backup file on file open
Hi everyone, and a happy new year. I want to include some code in a spreadsheet, whereby when a spreadsheet is opened it automatically creates and saves a backup with the days date in the file name ? Is it also possible to include whereby when the file is saved it saves itself with the days date, and if there is more than one save per day it saves a number on the file path ? eg: SavedFileBackup200601051.xls Hope that either or both of these options are doable. Thanks in advance Amy xx -- AmyTaylor ------------------------------------------------------------------------ AmyTaylor's Profile: http://www.excelforum.com/member.php...o&userid=20970 View this thread: http://www.excelforum.com/showthread...hreadid=498631 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving backup file on file open
You can save your file in the on open event. -- Kaak ------------------------------------------------------------------------ Kaak's Profile: http://www.excelforum.com/member.php...fo&userid=7513 View this thread: http://www.excelforum.com/showthread...hreadid=498631 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving backup file on file open
Thanks, but how ? Amy -- AmyTaylor ------------------------------------------------------------------------ AmyTaylor's Profile: http://www.excelforum.com/member.php...o&userid=20970 View this thread: http://www.excelforum.com/showthread...hreadid=498631 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving backup file on file open
Hi Amy,
Try: '============== Private Sub Workbook_Open() Dim sStr As String sStr = Format(Now, "yyyymmdd hh-mm") Me.SaveAs Filename:=Me.Name & " " & sStr, _ FileFormat:=xlWorkbookNormal End Sub '<<============== This is workbook event code and should be pasted into the workbook's ThisWorkbook module *not* a standard module or a sheet module): '============== Right-click the Excel icon on the worksheet (or the icon to the left of the File menu if your workbook is maximised) Select 'View Code' from the menu and paste the code. Alt-F11 to return to Excel. '<<============== This will not add a sequential number to multiple daily backups, but it adds the backup time. Hopefully, this will satisfy your requirements. --- Regards, Norman "AmyTaylor" wrote in message ... Hi everyone, and a happy new year. I want to include some code in a spreadsheet, whereby when a spreadsheet is opened it automatically creates and saves a backup with the days date in the file name ? Is it also possible to include whereby when the file is saved it saves itself with the days date, and if there is more than one save per day it saves a number on the file path ? eg: SavedFileBackup200601051.xls Hope that either or both of these options are doable. Thanks in advance Amy xx -- AmyTaylor ------------------------------------------------------------------------ AmyTaylor's Profile: http://www.excelforum.com/member.php...o&userid=20970 View this thread: http://www.excelforum.com/showthread...hreadid=498631 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving backup file on file open
Thank you very much Norman, sorry for not getting back to you until now. Can you let me know, is it possible to change the code so that: a) the file is only saved when the file is opened as read-write and not read-only and b) can the backup copy be saved to a directory in the same file path called \backup ? Thanks for your help Amy xx -- AmyTaylor ------------------------------------------------------------------------ AmyTaylor's Profile: http://www.excelforum.com/member.php...o&userid=20970 View this thread: http://www.excelforum.com/showthread...hreadid=498631 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excels auto recovery file is saving as a backup, how do i stop tha | Setting up and Configuration of Excel | |||
Everytime i close an excel file, it creates a new backup file | Excel Discussion (Misc queries) | |||
Create an automatic backup file on open in EXCEL? | Excel Discussion (Misc queries) | |||
how can open backup file | Excel Discussion (Misc queries) | |||
Backup in Saving a file in Excel 2002 | Excel Discussion (Misc queries) |