View Full Version : Running macros from within a PowerPoint 2010 template
stevecraig
01-21-2016, 07:08 AM
Hi All
I am new to PowerPoint VBA but have experience with word and excel VBA. I am trying to get my macros to run within a new presentation based on a PowerPoint macro template.
So here's the thing.
How do I make the macros automatically activate when I create a new presentation from a presentation template?? All of the VBA code has been written and will run perfectly when I use the View > Macros menu but not from the icons that I have created and linked to the run commands (macros) although the icons are still visible.
Is there anyone that can give me a line on this
Many Thanks
Steve
John Wilson
01-21-2016, 08:30 AM
Do you mean icons on the ribbon or QAT?
If so the short answer is it won't work. The design is stupid and those icons link to the macros in the original potx (which is not open) NOT the new presentation based on it. If theicons are on the slide then they will only work in slide show mode.
stevecraig
01-22-2016, 01:49 AM
thanks John for your reply.
SO how can we run macros within presentations that are created from a template? Is there NO WAY this can be done??
John Wilson
01-22-2016, 05:32 AM
You didn't answer the important question!
Do you mean icons on the ribbon or QAT?
In nearly every case we create a .ppam AddIn that can detect the Template in use.
stevecraig
01-22-2016, 05:45 AM
Hi John
Sorry about that
I have created a new group on the existing "Home" tab and then created icons in that group that will launch the custom colour swatches as selected and then the colour that is chosen from the swatch.
All of these are within a macro enabled PowerPoint template that will be added to the "My templates" option within the File > New menus area for all users within that business division.
You also mention an "Add-in". To be honest I have heard about this but wouldn't have a clue as to how to create one to use
Does that make sense?? If not, let me know
Thanks
Steve
John Wilson
01-22-2016, 06:03 AM
That helps me but not you. Buttons added to the ribbon do not work in potm files. As I said the design is crazy. The button points to the potm file not the new file that normally opens. Assuming you created the icons in XML - If you open a new file based on the potm and save it as a ppam PowerPoint AddIn. and then enable the developer tab if you haven't already. Addins > Add New >load the ppam you just saved. You only need to do this once. You may need to change the code a a little to poiunt to the correct presentation. But it should run and you no longer need the code in the potm at all.
I know it's confusing!
There 's a very basic tutorial on our site
http://www.pptalchemy.co.uk/custom_UI.html
stevecraig
01-22-2016, 06:15 AM
Hi John
Thanks for the prompt reply. And YEP, it does sound confusing. I will give it a go with your instructions and see what happens.
The process seems straight forward so hopefully this will sort it out.
Thanks again, and if I don't reply sooner rather than later, have a great weekend
Steve
Paul_Hossler
01-22-2016, 08:50 AM
FWIW -- Using Office 2016
I created a simple POTM with 3 buttons on the ribbon and saved it to my Templates folder
Open PP, File, New for the above template, and then saved the created file as a PPTM, closed it, an reopened it enabling macros
The ribbon seems to call the macros in the PPTM file
I think this was the question
John Wilson
01-22-2016, 09:11 AM
Except
A. You have to convince people to re-save (they won't in my experience)
B. Every saved file will contain the code which will cause problems for someone down the line with security settings
Paul_Hossler
01-22-2016, 09:23 AM
Darn users
My experience is that it's almost as hard as getting a user to save an add in correctly and enabling it
John Wilson
01-22-2016, 09:47 AM
Tis True but at least once it is enabled it's there and this can be an admin task if necessary - you need to constantly get people to save . We usually package as a self installing msi but I guess that's over the top here.
Paul_Hossler
01-22-2016, 10:30 AM
And there's the matter of template updates, either the macros or the 'standard' formatting
You have to distribute to hopefully all the people that you know are using it and then it has to be installed again
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.