I found a piece of code that creates a clock on a power point slide. All credit for this goes to The Tech Train Youtube channel.
My issue lies in the fact that in the video he is starting the code from an action button but I want to start it when the slide actually loads. I have been able to get it to start but when I do, it seems to freeze the slideshow in place and I can't proceed.
Here is the code for the clock:
Public clock As BooleanPublic currenttime, currentday As StringSub Pause()Dim PauseTime, startPauseTime = 1start = TimerDo While Timer < start + PauseTimeDoEventsLoopEnd SubSub StartClock()clock = TrueDo Until clock = FalseOn Error Resume Nextcurrenttime = Format((Now()), "h:mm:ss AM/PM")'to remove am/pm comment the following line outcurrenttime = Mid(currenttime, 1, Len(currenttime) - 3)ActivePresentation.Slides(SlideShowWindows(1).View.CurrentShowPosition).Shapes("shpClock").TextFrame.TextRange.Text = currenttimePauseLoopEnd SubSub OnSlideShowPageChange(ByVal objectWindow As SlideShowWindow)clock = FalseActivePresentation.Slides(SlideShowWindows(1).View.CurrentShowPosition).Shapes("shpClock").TextFrame.TextRange.Text = "--:--:--"End SubSub OnSlideShowterminate()clock = FalseEnd Sub
My problem is that using this code, I cannot advance to the next slide or close the slideshow. The code works great if I attach it to an action button but I want it totally automatic.