Paul
Paul

Reputation: 73

PowerPoint VBA code not running unless VB editor opened first

I have a PowerPoint presentation which consists of a single slide and some VBA code. The code displays a dialog box (not inside the presentation) which configures the slide. I need the code to be started when the presentation is started. I found various suggestions and ended up going with this one however I am getting inconsistent results!

If I do the following, in sequence, it works:

  1. Open presentation in PowerPoint
  2. Select Developer tab
  3. Select Visual Basic (to open VBA editor)
  4. Close VBA editor
  5. Select Slide Show tab
  6. Select From Beginning

However, if I skip steps 2-4, it does not! I.E.: 1. Open presentation in PowerPoint 2. Select Slide Show tab 3. Select From Beginning

It is almost as though Visual Basic support isn't even loading until the editor is opened.

I also tried adding a slide before my main one with an auto-transition immediately and again, no-go.

This is driving me insane as I need to get this deployed to the rest of my department.

Anyone have any ideas?

Upvotes: 2

Views: 4024

Answers (1)

Steve Rindsberg
Steve Rindsberg

Reputation: 14809

It's kind of a known problem.

OnSlideShowPageChange sometimes doesn't fire. To get around it, add any of the Active-X controls from the Developer tab to the first slide. Scoot it off the slide if you don't want it visible.

Somehow the control forces VBA to initialize, so events fire.

After I did this with your presentation, it fired off right away.

Upvotes: 4

Related Questions