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

Proud member of

PPTools

FREE PPTools add-ins like THOR - The Hammer!, ImageInsert, Narrator, SelectionManager and more

Merge Excel data into PowerPoint presentations to create certificates, awards presentations, personalized presentations and more

Image Export converts PowerPoint slides to high-quality images.

PPT2HTML exports HTML even from PowerPoint 2010 and 2013, gives you full control of PowerPoint HTML output, helps meet Section 508 accessibility requirements

Resize your presentations quickly and without distortion

Language Selector switches the text in your presentation from one language to another

FixLinks prevents broken links when you distribute PowerPoint presentations

Shape Styles brings styles to PowerPoint. Apply complex formatting with a single click.

Create an ADD-IN with TOOLBARS that run macros

Before we start

If you're writing an add-in for any version of PowerPoint from 2007 onward, this page has plenty of useful information, but please ignore the parts about creating toolbars to give your add-in a friendly user interface. Instead, see Our FAQ page on creating an add-in with ribbon buttons.

OK. Onward!

Unlike Word and Excel, PowerPoint doesn't have a simple way to automatically run VBA code when you open a particular PPT file or create a new document based on a template.

However, if you create an add-in that includes an Auto_Open subroutine, PowerPoint will run the code in Auto_Open when the add-in loads. It will also run any code in an Auto_Close subroutine when the add-in is unloaded manually via the Tools, Addins dialog or when you quit PowerPoint.

Once loaded, an add-in will load itself every time PowerPoint starts up.

Running code once can be useful, but what if you want to make your macros available at the click of a button? To do that, your add-in has to create a toolbar and add buttons to it. Each button can be associated with other macros in your add-in.

So how do you create an add-in that does all this wonderful stuff?

A Must-See Site: PowerPoint MVP Shyam Pillai's PowerPoint Add-in FAQ

And of course, peruse the rest of the Programming section in this FAQ for code examples and more.

Here are the basics. This shows you how to create an add-in and a toolbar with buttons that you can click to run macros. This will also work In PowerPoint 2007 and onward, where your toolbar will appear on the Add-ins tab. If you want to create your own tabs or groups on the ribbon, the process is a bit more complicated. In that case, see:

Page copy protected against web site content infringement by Copyscape Contents © 1995 - 2023 Stephen Rindsberg dba PPTools and 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.

Supercharge your PPT Productivity with PPTools

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

Create an ADD-IN with TOOLBARS that run macros
http://www.pptfaq.com/FAQ00031_Create_an_ADD-IN_with_TOOLBARS_that_run_macros.htm
Last update 20 June, 2023
Created: