Cedric
Cedric

Reputation: 333

VBA powerpoint, run timed task/macro in background across presentation

I am trying to build a presentation with a counter/number in the footer which evolves with time (as a function of some external data set present in an Excel spreadsheet). I developed the VBA code for loading data from the spreadsheet, built a footer in the Slide Master and a macro for updating the counter in it (and even graph some data in the footer), but I am unable to build the mechanism for updating the counter - e.g. every 2 seconds - across the presentation (by that I mean that the update has to happen independently of the active/view slide). I've seen a few threads with similar topics [ref, ref], which were not really answered or active, hence my question: is there a way to build a background timer for launching macros in VBA/Powerpoint?

Thank you and best regards,

Cedric

Upvotes: 0

Views: 5318

Answers (1)

David Hayes
David Hayes

Reputation: 7512

Excel has an Application.OnTime event to handle this but I can't see one in Powerpoint. Not sure what your setup is but if you have an Excel sheet open as well you could use Application.OnTime from Excel to run the Macro in Powerpoint

Something like

Excel

Application.OnTime Now + TimeValue("00:00:15"), "my_Procedure"

Public Sub my_procedure() Dim PPObj As Object Set PPObj = CreateObject("PowerPoint.application") PPObj.Run "myPPTFile.ppt!MyMacro" End Sub

Upvotes: 1

Related Questions