Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excels auto recovery file is saving as a backup, how do i stop tha EPSCoR Setting up and Configuration of Excel 6 March 20th 09 05:49 PM
Everytime i close an excel file, it creates a new backup file p Excel Discussion (Misc queries) 3 November 22nd 07 08:13 AM
Create an automatic backup file on open in EXCEL? bjohnsonnc Excel Discussion (Misc queries) 1 September 20th 07 04:45 PM
how can open backup file Tufail Excel Discussion (Misc queries) 4 February 14th 07 09:39 PM
Backup in Saving a file in Excel 2002 4rs Excel Discussion (Misc queries) 1 January 14th 05 05:09 AM


All times are GMT +1. The time now is 03:18 AM.

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

About Us

"It's about Microsoft Excel"