Consulting

Results 1 to 1 of 1

Thread: VBA Timer Not Working Suddenly

  1. #1
    VBAX Regular
    Joined
    Feb 2022
    Posts
    37
    Location

    VBA Timer Not Working Suddenly

    Hello All! Recently the standard timer that I use in many PPTs has suddenly stopped working. The time does not update on the screen (Within the "Timer" object) and the conditional does not happen at the end. It only seems to update when I constantly cursor over the screen, or click around. However, the code will function somewhat in a new, clean Powerpoint.

    So... What other elements could be affecting this code? What would cause it to lag, or not update? Why would it suddenly stop working (I've used it for over a year)?
    I can't figure it out Any theories would be greatly appreciated!

    Sub Timer ()
    
    Dim time As Date
    time = Now()
    Dim countdown As Integer
    countdown = 5
    time = DateAdd("s", countdown, time)
    Do Until time < Now()
    DoEvents
    ActivePresentation.Slides(1).Shapes("Timer").TextFrame.TextRange = Format((time - Now()), "hh:mm:ss")
    Loop
    If time < Now() Then
    * DO THE THING *
    End If
    
    End Sub
    Last edited by Kellaroo; 06-22-2023 at 12:58 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •