DPChristman
Board Regular
- Joined
- Sep 4, 2012
- Messages
- 191
- Office Version
- 365
- Platform
- Windows
I had set this macro up as an automatic Save and Close if there was no activity in x minutes.
However, I have noticed lately that it is saving an closing even while I am working on it.
Especially when I am make important changes to the workbook.
Any Idea?
Dim CloseTime As Date
Sub TimeSetting()
CloseTime = Now + TimeValue("00:15:00")
On Error Resume Next
Application.OnTime EarliestTime:=CloseTime, _
Procedure:="SavedAndClose", Schedule:=True
End Sub
Sub TimeStop()
On Error Resume Next
Application.OnTime EarliestTime:=CloseTime, _
Procedure:="SavedAndClose", Schedule:=False
End Sub
Sub SavedAndClose()
ActiveWorkbook.Close Savechanges:=True
End Sub
However, I have noticed lately that it is saving an closing even while I am working on it.
Especially when I am make important changes to the workbook.
Any Idea?
Dim CloseTime As Date
Sub TimeSetting()
CloseTime = Now + TimeValue("00:15:00")
On Error Resume Next
Application.OnTime EarliestTime:=CloseTime, _
Procedure:="SavedAndClose", Schedule:=True
End Sub
Sub TimeStop()
On Error Resume Next
Application.OnTime EarliestTime:=CloseTime, _
Procedure:="SavedAndClose", Schedule:=False
End Sub
Sub SavedAndClose()
ActiveWorkbook.Close Savechanges:=True
End Sub