PowerPoint VBA / Macro Controls On Slides – Return Focus To The Slide

I recently had the need to add some functionality to some PowerPoint presentations. While it was “fun” to use VBA (brought be back to the classic .asp days) I had forgotten a few issues. One main issue, if you have a button on a slide, when the button is clicked, the focus still remains on the button, not the slide. If you press next or use a presentation ‘clicker’ it won’t advance the slide because you’re still focused on the button. The easiest way I’ve found to return focus back to the slide is by hiding and showing the control. See below:

Private Sub cmdYourButton_Click()
'Do something cool here
cmdYourButton.Visible = False
cmdYourButton.Visible = True
'Focus is now back on the slide!
End Sub

One final note: if you’re looking for the “Developer” tab in PowerPoint, go to File > Options > Customize Ribbon and check “Developer” under ‘Main Tabs’.

Happy presenting!

PowerPoint VBA / Macro Controls On Slides – Return Focus To The Slide

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s