Supercharge your PowerPoint productivity with

Supercharge your PPT Productivity with PPTools - Click here to learn more.

Tell me about PPTools

Will VBA solve my presentation problem?


PPTools
Shape Styles brings the power of styles to PowerPoint. Apply complex formatting with a single click
Merge Excel, CSV or tab-delimited data into PowerPoint presentations to create certificates, awards presentations, personalized presentations and more
FixLinks prevents broken links when you distribute PowerPoint presentations
Optimizer saves disk space and bandwidth, shrinks your PowerPoint presentations to the right size for email, screenshow or printing
PPT2HTML gives you full control of PowerPoint HTML output, helps meet Section 508 accessibility requirements
Prep4PDF preserves interactivity in PowerPoint presentations when you convert to PDF
Image Export converts PowerPoint slides to JPG, PNG, GIF, WMF and more

Before deciding on a VBA solution to a problem, you should understand the limits of VBA. What follows may sound very negative. It's not really meant that way. It's a brutally honest look at what you can and can't expect VBA to do for your presentations.

We'd much rather learn that "You can't do that" before we spend weeks pounding our head against the walls learning that "You can't do that". That in turn might save you the cost (and embarassment) of planning an important presentation around VBA tricks that turn out to be impossible.

Will you use PowerPoint Viewer?
If your presentation needs to run in the free PowerPoint Viewer, then VBA is out. The Viewer doesn't support VBA at all.

You can control the older PPT97/2000 viewer from external programs to a limited extent. The new PowerPoint 2003 Viewer lacks even this ability. Automating the Viewer

Security Settings
If you don't need to rely on the Viewer and can assume that PowerPoint will be installed, the next thing to consider is the security settings on the individual computers. Do you control these settings or can you persuade individual users to adjust the settings to meet your needs?

If the user's macro security is set to Medium, PowerPoint will ask the user whether to allow the code to run when they open the presentation file that contains it. If their security's set higher than Medium, PowerPoint won't even ask. It silently disables any macros/VBA code. PowerPoint 2007 makes things even fussier.

Running on a Mac?
VBA won't work in Mac PowerPoint 2008.

Mac PowerPoint 2004 and previous support VBA. Mac PowerPoint 2008 does not. Later versions of Mac PowerPoint should support VBA again.

Code That Runs Automatically
Some Office applications have a way to run VBA code automatically when the user opens a document.

PowerPoint doesn't.

An Auto_Open subroutine within an Add-in will run at the time the Add-in loads, so IF you can create an Add-in and install it on the user's computer Create an ADD-IN with TOOLBARS that run macros then

  • The Add-in can respond to events - Make PPT respond to events
  • It can detect things like "The user just opened a presentation".
  • You could use this and some extra code to detect that "The user just opened OUR presentation" and run any other code you like in response.

Can VBA even do this?
Even if you're still with us, VBA may not be the answer. VBA allows us to automate nearly everything that PowerPoint can do. It even allows us to do some things that PowerPoint can't do under normal user control. But PowerPoint doesn't "expose" all of its capabilities. There are some features that a user can click with a mouse but that VBA simply can't "see". What PowerPoint doesn't expose, VBA can't control and we can't automate.

How can you tell what can and can't be controlled?

  • Have a look at the rest of the VBA section of this FAQ and some of the other PowerPoint VBA sites it links to. You may find that somebody's already written code that does what you want.
  • Record a macro as you perform the task manually. Play the macro back. If it works, you're in good shape. The recorded macro may not always work the way you want it to, but that's fixable. The fact that it works at all proves that VBA can do what needs to be done.
  • The PowerPoint Newsgroup is your Friend. Post a detailed message outlining what you need to do and you'll have a reliable answer from one or more experienced PowerPoint coders within 24 hours or less.


Page copy protected against web site content infringement by Copyscape Contents © 1995 - 2008 Stephen Rindsberg, Rindsberg Photography, Inc. and members of the MS PowerPoint MVP team. You may link to this page but any form of unauthorized reproduction of this page's contents is expressly forbidden.

Español    Deutsch    Français    Português    Italiano    Nederlands    Greek    Japanese    Korean    Chinese



Supercharge your PPT Productivity with PPTools


content authoring & site maintenance by
Friday, the automatic faq maker (logo)
Friday - The Automatic FAQ Maker

Will VBA solve my presentation problem?
http://www.pptfaq.com/FAQ00611.htm
Last update 22 December, 2008