ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Backing Up Open Excel Files - with a Timing Component (https://www.excelbanter.com/excel-programming/377577-backing-up-open-excel-files-timing-component.html)

[email protected]

Backing Up Open Excel Files - with a Timing Component
 
Dear All,

there has been some good examples of code in the past to automatically
save a copy of an Excel file as a backup. eg.... my version of an
example by Tom earlier this year...

Sub BackupFile()

Dim pPath As String

With ActiveWorkbook
sStr = Left(.FullName, Len(.FullName) - 4) & "_backup_" & _
Format(Now, "dd Mmm yy hhmm") & ".xls"


Debug.Print sStr
.SaveCopyAs sStr
End With

MsgBox "Your file has been saved as requested."

End Sub

Is there a way to have this timed so that every nominated time period
(eg 10mins) this code will automatically run? I have the above code in
my Personal.xls sheet so it can be accessed by all open Excel files via
a button on a customised toolbar.

Is there also a way to nominate a directory to save this in (eg not the
current directory of the file, but maybe a designated "Backup Folder"?


Many thanks,

punter.....



All times are GMT +1. The time now is 10:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com