Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • Last Modified:

How can I stop current timers from firing again and terminate a sub

I have a timer that is fired every 100ms inside that timer I have different sub routine that are executed. If I hit a condition in which I would like to stop the timer and also exit the sub without re entering how could I do that?
0
cmdolcet
Asked:
cmdolcet
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Stop the timer and exit the sub, just like you said?

    Timer1.Stop()
    Exit Sub
0
 
MMTadminCommented:
Every 100ms damn that's a lot of doing

Private Sub Timer

Timer.enabled = false
DoThis

End Sub

Private Sub DoThis

Debug.Print "Hello"
Timer.Enabled = True

End Sub
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now