Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Timed Auto Save Macro?
- eddy said:
- Jul 21st, 2002 10:31 AM
- Default
- Is it possible to have an "auto run" macro which runs as soon as the workbook is opened, and then auto save the workbook every "x" mins. into the original path (without getting any dialogs e.g save as, yes/no boxes)? The workbook must always remain open.
- All help appreciated.
- eD
- Timed Auto Save Macro?
- Tom Schreiner said:
- Jul 21st, 2002 10:48 AM
- Default
- Hi Ted.
- Copy this into any standard module:
- Option Explicit
- Public RunTime
- Sub StartTimer()
- RunTime = Now + #12:10:00 AM#
- Application.OnTime RunTime, "SaveBook", schedule:=True
- End Sub
- Sub SaveBook()
- ActiveWorkbook.Save
- StartTimer
- End Sub
- Sub StopTimer()
- On Error Resume Next
- Application.OnTime RunTime, "SaveBook", schedule:=False
- End Sub
- Place this in your workbook class module:
- Private Sub Workbook_Open()
- StartTimer
- End Sub
- Private Sub Workbook_BeforeClose(Cancel As Boolean)
- StopTimer
- End Sub
- This will save your workbook every 10 minutes without interupting you.
- Tom
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement