Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calling a macro based on a sub-routine from a loaded ppa file

7 views
Skip to first unread message

B

unread,
May 17, 2003, 1:19:12 AM5/17/03
to
I hate to be stupid. Doesn't mean that I'm not, just that I don't like it.
PPT VBA has shown me yet another gap in my programming self education.

I have written a module in VBA (yeah!). The basics are that I want the user
to be able to call a subroutine associated with shapes via Action Settings |
On Mouse Click | Run Macro | DoThisThing. This works fine (yeah!) while I
am using it from Visual Basic Editor with visible Userforms and Modules. I
would like to make it into a PPA file.

When I compile the code, save it as a PPA, load the new add-in, and start a
new presentation -- the macro DoThisThing no longer appears on the users
macro list (booo!).

I'm guessing I need to add an Auto_Open subroutine to the project, that will
define DoThisThing as a macro and add it to the users available macro list.
I have been looking for a couple of days, and either haven't seen what I
need, or haven't recognized it when I saw it.

Can anyone point to a site, post a code, or show me what I need to do?


B

I'm sure I will kick myself when the light bulb finally snaps on, but for
now, I'm a tad frustrated. I think gray hair is an undocumented VBA
feature.


Shyam

unread,
May 17, 2003, 8:47:04 AM5/17/03
to
B,
You will need to create a macro in the active presentation which invokes the
macro in the PPA and assign the macro in the PPT to the action button.

e.g if you wish to invoke a macro called 'MyMacro' in 'MyPPA.PPA" and
provided that the PPA is loaded. Then you can use the following:

Option Explicit
Sub CallPPARoutine()
Application.Run "MyPPA.ppa!MyMacro"
End Sub

You can also provide the complete path to the PPA in the calling sequence.
This would load the add-in incase it isan't already loaded.
Option Explicit
Sub CallPPARoutine()
Application.Run "C:\Temp\MyPPA.ppa!MyMacro"
End Sub

Now, since CallPPARoutine resides in the currently active presentation, it
will appear in the list of macros available in the action setting dialog.


--
Regards
Shyam Pillai

Handout Wizard
http://www.mvps.org/skp/how/

"B" <vest...@yahoo.com> wrote in message
news:uNMwJODH...@TK2MSFTNGP11.phx.gbl...

B

unread,
May 18, 2003, 2:19:59 AM5/18/03
to
Thank you. This is exactly what I was looking for (and at) and did not see.

B


"Shyam" <Sh...@Asia.com> wrote in message
news:emP72JHH...@TK2MSFTNGP10.phx.gbl...

0 new messages