Countdown timer in Powerpoint pauses....

glad_ir

Board Regular
Joined
Nov 22, 2020
Messages
146
Office Version
  1. 2010
Platform
  1. Windows
Hi,

I wonder if somebody can help me please. I am using the macro below (provided by a member on this site :-)) to run a countdown timer on an object in a powerpoint slide when I click the object linked to the macro. The timer works well (in presentation mode) as long as I don't navigate away from the slide containing with the object. However, if I navigate away from the slide the timer pauses.

Does anybody know if there is a way to keep the countdown time running when I navigate away from the slide (in presentation mode)?

Any help is very much appreciated!

Thanks,
Iain

VBA Code:
Sub macroCONTROL()

Dim time As Date
time = Now()

Dim count As Integer
count = 120

time = DateAdd("s", count, time)

Do Until time < Now()
DoEvents
ActivePresentation.SlideShowWindow.View.Slide.Shapes("Rectangle 7").TextFrame.TextRange = Format((time - Now()), "nn:ss")
Loop

CreateObject("Shell.Application").ShellExecute "wmplayer.exe", "c:\Ghost.mp3", , "open", 0

End Sub
VBA Code:
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Instead of referring to the active slide, try referring to the specific slide, for example...

VBA Code:
ActivePresentation.Slides("Slide1").Shapes("Rectangle 7").TextFrame.TextRange = Format((time - Now()), "nn:ss")

Change the slide name accordingly.

Hope this helps!
 
Upvote 0
Solution
Instead of referring to the active slide, try referring to the specific slide, for example...

VBA Code:
ActivePresentation.Slides("Slide1").Shapes("Rectangle 7").TextFrame.TextRange = Format((time - Now()), "nn:ss")

Change the slide name accordingly.

Hope this helps!
Hi Duncan, thank you for the prompt response. This has worked for me.

Thanks, Iain
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top