Question

I want to run a macro when I open a presentation. I try to do it using the following:

Sub Auto_Open()

    DoWhatIWant

End Sub

It works... but only if you open powerpoint from the powerpoint icon. But I want to run the macro also when I open the presentation just making double click on the presentation that I want to open.

Was it helpful?

Solution

PowerPoint won't run Auto_Open code when you open a presentation, only when an add-in loads.

You can have an add-in trap the event that's fired when the user opens a new presentation and have that run your code (perhaps after determining whether the code should run based on something to do with the presentation).

Or a PPTM presentation might include RibbonX that calls a VBA routine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top