Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim TimerActive As Boolean
- Dim Message As String
- Dim Counter As Integer
- Public Sub StartQuoteThread()
- TimerActive = True
- Message = "Timer running"
- Counter = 0
- 'Application.StatusBar = DateAdd("s", 3, Time)
- 'Application.OnTime CDate(Application.StatusBar), "timer.Timer"
- Application.OnTime Now() + TimeValue("00:00:03"), "timer.Timer"
- End Sub
- Sub StopTest()
- Call StopQuoteThread("lol")
- End Sub
- Public Sub StopQuoteThread(Optional text = "STOPPED")
- TimerActive = False
- Message = text
- Call EnableApplicationSettings
- Call HideProgressBar
- End Sub
- Public Sub Timer()
- If TimerActive Then
- Counter = Counter + 1
- Debug.Print "SubThreadIteration= " & Counter
- 'Application.StatusBar = DateAdd("s", 3, Time)
- 'Application.OnTime CDate(Application.StatusBar), "timer.Timer"
- Application.OnTime Now() + TimeValue("00:00:03"), "timer.Timer"
- Else
- If Message <> "NO-MESSAGE" Then
- Msg = Message ' Define message.
- Style = vbOKOnly ' Define buttons.
- Title = "PAVA - SDT" ' Define title.
- response = MsgBox(Msg, Style, Title)
- Else
- Debug.Print "SubThread Stopped"
- End If
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement