I have a subroutine in VBA that is executed when we open a PowerPoint presentation but I want to execute that Sub when an Add-in is loaded instead.
How can I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I’m understanding you correctly, you have an add-in that you want to run the sub-routine of an existing slide deck only when the addin is loaded.
If so, here are instructions on how to do this:
Create a slide deck, save it as
“Presentation3.pptm” (macro-enabled
PPT for 2007). Open the VBE and put
in the following code:
Create an add-in now. Create another
deck, go to the VBE and put this in
any module:
Now save this add-in as a PowerPoint
Add-in (.ppam). Install and load the
addin (try unload/load again if it
doesn’t trigger) and you should have
a textbox created on the active
presentation.
Notice in #2 :
Application.Run (p.Name & "!AddText"). The presenation name (including extention) and “!” with the sub routine’s name are required to run a macro in another presentation.