S
Spencer Hutton
I use this to Save and close the workbook when the user is idle for 10 minutes:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim TimeOut As Date
TimeOut = Now() + TimeValue("00:10:00")
Application.OnTime TimeOut, "KillApp"
End Sub
Sub KillApp()
ThisWorkbook.Save
ThisWorkbook.Close
End Sub
But as soon as the workbook finishes saving and closing, it opens right back
up again??? Can anyone help?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim TimeOut As Date
TimeOut = Now() + TimeValue("00:10:00")
Application.OnTime TimeOut, "KillApp"
End Sub
Sub KillApp()
ThisWorkbook.Save
ThisWorkbook.Close
End Sub
But as soon as the workbook finishes saving and closing, it opens right back
up again??? Can anyone help?