Can't load addin containing ribbon code in PPT 2003

D

Dave Jenkins

I have developed an applicaiton which will run in either PPT 2007 or PPT
2003. If it's running in 2003, it manipulates menus and toolbars, and if
it's in 2007, it manipulates the ribbon. Works great, and all I have to do
is install a .ppa version of the code in 2003, and a .ppam in 2007, and
that's pretty automatic -- the installer takes care of decisions like that.
About the only hassle is having to do two different saves each time I want to
run some tests. But no code changes are required to satisfy the differing
requirements of 2003 vs. 2007.

That is, until this weekend, when all of a sudden the addin quit loading on
2003. And here's why:

It appears that the addin loader in 2003 is smart enough to look at the
module definition of subs, functions, etc. that are explicitly called in the
addin's vba code. In my case, I had this code, and had added the indicated
sub and inserted a call to it in some form code:

Private myRibbon As IRibbonUI
Sub WISToolsCustomUI_onLoad(ribbon As IRibbonUI)

Set myRibbon = ribbon

End Sub

Sub InitializeRibbon() <------ added code

myRibbon.Invalidate <------- added code

End Sub <-------- added code

All I had to do to make the code load in 2003 was to comment out the call to
InitializeRibbon(). However, that, of course, crippled my 2007 ribbon
manipulation code. (Note: I think it's interesting that the 2003 loader
doesn't barf at the existence of a variable definition that it really doesn't
know about (IRibbonUI), it's only when it sees a call to a sub in a module
that contains a module level definition that it refuses to load.)

I've tried for hours to figure out a way to let the app compile on 2007, and
load as an addin on both platforms without having to change the code to
satisfy both the 2003 and 2007 addin loaders. I've tried, for instance, just
defining MyRibbon as an Object, but that doesn't work. (Does VBA have a Cast
or a type convrsion or something that would help?)

Can I accomplish what I'm after here, or do I have to bite the bullet and
add an extra step to my development procedure?

Thanks!
 
S

Shyam Pillai

Dave,
Bit the bullet. Take the extra step.

Alternately, you can try using Application.Run "<ppa
name>!modulename.routine" to invoke the init routine and see if that works
for you.


--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com
 
D

Dave Jenkins

Yeah - that's what I've been doing. Still a pain, though. I think I tried
something along the lines of what you suggested, but I'm pretty sure I didn't
use that exact syntax. I'll give it a try and *then* bite the bullet if it
doesn't work. It's not worth spending much more time on - just aggravating!

Thanks.
--
Dave Jenkins
K5KX


Shyam Pillai said:
Dave,
Bit the bullet. Take the extra step.

Alternately, you can try using Application.Run "<ppa
name>!modulename.routine" to invoke the init routine and see if that works
for you.


--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com
 
D

Dave Jenkins

That worked, Shyam -- thanks!

I had to use the <.ppam name>, since it was the 2003 loader that refused to
load the addin when it was referencing a sub that contained the module-level
definition of a ribbon object (but never calling it, I might add).

I guess the Application.Run successfully masked the module to be run from
the addin loader based on its name being in quotes?
--
Dave Jenkins
K5KX


Shyam Pillai said:
Dave,
Bit the bullet. Take the extra step.

Alternately, you can try using Application.Run "<ppa
name>!modulename.routine" to invoke the init routine and see if that works
for you.


--
Regards,
Shyam Pillai

Animation Carbon: Copy/Paste/Share animation libraries.
www.animationcarbon.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top