I have a timer once my workbook opens, after one minute aUserform pops up, and asks if you are still using the file. If you hit yes, theoriginal timer resets but if you hit no the workbook closes. However, when theuserform pops up a second timer starts, when this timer times out it closes theworkbook. I would like for the second timer to be cancelled if the user clicksyes in the userform. Here is my code. Thus far.
this is the code for the userfom
HTML:
Sub Start_Time()
Application.OnTime Now + TimeValue("00:01:00"), "Time_Form"
End Sub
Sub Time_Form()
TimerForm.Show vbModeless
End Sub
Sub Closeout()
Application.DisplayAlerts = True
ThisWorkbook.Save
ThisWorkbook.Close
End Sub
this is the code for the userfom
HTML:
Private Sub NoButton_Click()
Call Closeout
End Sub
Private Sub UserForm_Initialize()
Application.OnTime Now + TimeValue("00:01:00"), "Closeout"
End Sub
Private Sub YesButton_Click()
Unload Me
Application.OnTime Now + TimeValue("00:01:00"), "Start_Time"
IsNull (Ln = 8)
End Sub