Hi All,
For some reason this code works great but the MsgBox command doesn't work anymore:
Also is there a way to have a "Reopen" button so it reopens the Workbook it just closed as well as a "OK" button?
Thanks in advance!
For some reason this code works great but the MsgBox command doesn't work anymore:
VBA Code:
Option Explicit
Public DownTime As Double
Sub StartTimer()
DownTime = Now + TimeSerial(0, 30, 0)
Application.OnTime DownTime, "ShutDown"
End Sub
Sub StopTimer()
On Error Resume Next
Application.OnTime DownTime, "ShutDown", , False
End Sub
Sub ShutDown()
With ThisWorkbook
Application.DisplayAlerts = False
.Close Savechanges:=True
Application.DisplayAlerts = True
End With
MsgBox "Timed out after 30 minutes - Your work has been saved and closed"
End Sub
Also is there a way to have a "Reopen" button so it reopens the Workbook it just closed as well as a "OK" button?
Thanks in advance!