Backing Up Open Excel Files - with a Timing Component

P

punter1000

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.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top