I was wondering if there was a way to create macros that would
then be available to you all the time in Powerpoint – not just when you’re
in a particular file.
I know how to do it in Word – you put the macro in the Normal.dot
template. In Excel, you put the macro in Personal.xls which is always
open but hidden.
But is there a way to do this in Powerpoint? I think it might have something
to do with add-ins, but perhaps a Doper might be able to point me in
the right direction.
Yes, it has to do with Add-Ins. In older versions you could place it in your Blank Presentation.pot file, but for security reasons we disabled that in later versions.
You have to save the code as a PowerPoint Add-In (PPA) file, then place that Add-In in your Startup folder. When you relaunch PPT it will load the Add-In and make it available for launching when you go to Tools | Add-Ins. Further, if you name the Add-In “Auto_Open” it will execute automatically when you launch PPT. This works in both Win and Mac PPT.
Thanks for you help. I did exactly what you said (I thought)
but it’s still not working.
Here’s where I stand:
I started a blank presentation and recorded a simple macro. I saved
the blank presentation as an add-in, with the name Auto_Open.ppa
in my C:\Program Files\Microsoft Office\Office\STARTUP directory.
The macro is there, because the first time I tried to load the add-in
I got the Disable Macros/Enable Macros warning. The add-in loads
automatically when I launch Powerpoint now. But it’s as if the macro
isn’t there. It doesn’t appear in the macro list (nothing does) even
if I choose to look in All Presentations. The button on the toolbar that
I linked to the macro doesn’t work. Launching the Visual Basic editor
doesn’t help, it doesn’t appear there, either (only the open presentation
does).
Ah - I definitely wasn’t clear. The Module is what you need to name auto_open. Try this:
Launch PPT
Tools | Macro | VBE
Insert | Module
in the module:
Sub auto_open ()
msgbox “Mark is King”
End Sub
Close and return to PPT
File | Save As
Choose any filename and any location save as PPA
Tool | Add-Ins | New
Browse to wherever you saved the PPA, select it
It should now be loaded and ready every time you Quit and Restart PPT.
(This is easier than copying it to the startup folder manually, I should have mentioned it the first time). Now if you don’t want it to auto load, you can go to Tools | Add-Ins and deselect it, then choose to Load it as needed.
One more thing: If you don’t see the PPA loaded after going to Tools | Add-Ins, your security is too high - goto Tools | Macro | Security and change it to Low.
Okay, that did work, but I think this time I’m the one not being clear.
This is for my work. I want to write macros for people to use while
they’re in Powerpoint. Like for instance a macro that just prints the
page they’re working on. I know how to write the macro. I just
don’t know how to store it in such a way that it’s available to
people to use, whenever they want it, in all presentations.
The auto_open thing in your last post worked, but as you know it
just works upon open. I couldn’t even get it to work again afterwards.
So how would I get a macro named PrintPage, say, to be available to me,
anytime I wanted in, in any presentation?
Sorry to be a bother, but this will be a great help to us all if I can figure
it out.
If you don’t want it to auto load, just call the module something else, (Sub Foo () or something), make sure their security is set to low, then have them go to Tools | Add-Ins and browse to wherever the PPA is shared. It will now be loaded whenever they start PPT but not run. If you want them to launch PPT and have it add toolbar buttons or menu items automatically such that the code will execute when the menu item or toolbar button is enabled, this is how to do it.
Hmmm…I think the problem is that, at work, we have an older version
of Powerpoint. We’re using Powerpoint 97, still. Would you believe.
With Windows 2000. I know it’s out of date, but that’s what I have
to work with.
Anyway, in this version, there is no Tools | Macro | Security.
When I try to open an Add-In to edit it, it just loads it. So
I have to start from scratch each time. I can make an add-in,
I can put a macro in an add-in, I can get the add-in to load
each time – but the macro doesn’t show up anymore.
I’ve already tried putting a macro in my Blank Presentation.pot,
but that doesn’t seem to work either.
I’m starting to think there’s just no way to do this. Dooku,
thanks for your help and sorry to be a bother.