Melmillw82
New Member
- Joined
- Nov 14, 2017
- Messages
- 27
Hi everyone,
I am trying to auto save a worksheet every 5 mins using vba code. I have saved the code to workbook and module and it saves every 5 mins. Issue is it reopens any excel file that was open and it saves those files too. Any suggestions??
Thanks in advance.
Saved in workbook.
Private Sub Workbook_Open()
alertTime = Now + TimeValue("00:01:00")
Application.OnTime alertTime, "SaveMe"
End Sub
Saved in module
Public Sub SaveMe()
ActiveWorkbook.Save
alertTime = Now + TimeValue("00:01:00")
Application.OnTime alertTime, "SaveMe"
End Sub
I am trying to auto save a worksheet every 5 mins using vba code. I have saved the code to workbook and module and it saves every 5 mins. Issue is it reopens any excel file that was open and it saves those files too. Any suggestions??
Thanks in advance.
Saved in workbook.
Private Sub Workbook_Open()
alertTime = Now + TimeValue("00:01:00")
Application.OnTime alertTime, "SaveMe"
End Sub
Saved in module
Public Sub SaveMe()
ActiveWorkbook.Save
alertTime = Now + TimeValue("00:01:00")
Application.OnTime alertTime, "SaveMe"
End Sub