L
Legacy 98055
Guest
Hi Guys.
In the following procedure, when the user places a check in in this CheckBox, a procedure is run every 60 seconds.
The code continues looping until the checkbox is unchecked.
What is the code needed to cancel the OnTime method?
The help files for the OnTime method only give an example for a static time, not a loop.
This is the line I am using in my attempt to cancel the method.<pre>
Application.OnTime Procedure:="RefreshDeTime", Schedule:=False</pre>
Thanks,
Tom<pre>
Private Sub CheckBox1_Click()
Do Until CheckBox1.Value = False
Application.OnTime Now + TimeValue("00:00:60"), "RefreshDeTime"
Sheet1.Range("D2").Value = Now
ActiveWorkbook.save
Loop
Application.OnTime Procedure:="RefreshDeTime", Schedule:=False
End Sub</pre>
This message was edited by TsTom on 2002-04-26 15:12
This message was edited by TsTom on 2002-04-26 15:41
In the following procedure, when the user places a check in in this CheckBox, a procedure is run every 60 seconds.
The code continues looping until the checkbox is unchecked.
What is the code needed to cancel the OnTime method?
The help files for the OnTime method only give an example for a static time, not a loop.
This is the line I am using in my attempt to cancel the method.<pre>
Application.OnTime Procedure:="RefreshDeTime", Schedule:=False</pre>
Thanks,
Tom<pre>
Private Sub CheckBox1_Click()
Do Until CheckBox1.Value = False
Application.OnTime Now + TimeValue("00:00:60"), "RefreshDeTime"
Sheet1.Range("D2").Value = Now
ActiveWorkbook.save
Loop
Application.OnTime Procedure:="RefreshDeTime", Schedule:=False
End Sub</pre>
This message was edited by TsTom on 2002-04-26 15:12
This message was edited by TsTom on 2002-04-26 15:41