PowerPoint macro works but not in add-in

  • Thread starter Thread starter jpr3
  • Start date Start date
J

jpr3

I have written PowerPoint VBA code that works in any presentation (it
calls a UserForm to show). I have written VBA code that will
automatically call this code whenever ANY presentation is opened
(Auto_Open) and saved it to a .PPA file. But while the macro works, it
doesn't work in the Add-In. What could I be doing wrong?

Here is some code from my AutoOpen macro:
With MyButton2
..Caption = "Style1"
..TooltipText = "Style1"
..OnAction = "Style1"
.Visible = True

I would appreciate any help that you could give me.
 
You will have to tell us more about the code before we can all help you!

You might also add....
Is the macro you want to run called " sub style 1"?
Did the addin compile OK?
Does the button appear?
 
I have written PowerPoint VBA code that works in any presentation (it
calls a UserForm to show). I have written VBA code that will
automatically call this code whenever ANY presentation is opened
(Auto_Open) and saved it to a .PPA file. But while the macro works, it
doesn't work in the Add-In. What could I be doing wrong?

It's not clear what the add-in's supposed to do and when you expect it to
"fire". For example, it will not run the AutoOpen macro every time a
presentation is opened, only when the Add-in itself loads.
Here is some code from my AutoOpen macro:
With MyButton2
..Caption = "Style1"
..TooltipText = "Style1"
..OnAction = "Style1"
.Visible = True

Does it even compile? With the extra (unneeded) dots I'd expect not. There
should only be one dot at the beginning of each of those lines.
 
His original post, on my system only had single dots. Most weird. We've
seen this before in the NGs, extra periods sometimes, I mean.

Depending on the code that comes before, this is probably meant to address
some of the details on a newly created button on a toolbar. We'd have to
see what comes before to inform you if MyButton2 was correctly defined and
created.

When this command is fired, it should fire the Sub routine Style1 in the
module section of your code. Where is the code for Style1 located?


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
His original post, on my system only had single dots. Most weird. We've
seen this before in the NGs, extra periods sometimes, I mean.

Isn't this where the newsreader's supposed to fall on its knees and beg us to
"Kill me before I stop again"
 
Back
Top