View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jon Peltier Jon Peltier is offline
external usenet poster
 
Posts: 6,582
Default What's special about iRibbonControl?

I was going to suggest this, or parallel versions for Excel 2007 and the
Excel we've known and used for a decade.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Jim Rech" wrote in message
...
Do you know why


I do not, Josh. I was as surprised as you to see the passed object had to
be recast to be usable.

my add-in does need to compile without error under XL2003.


A sticky wicket, as the Brits say. What I'm doing with my apps that I
want to work in all XL environments is have my main app file load another
add-in under XL2007 with RibbonX, etc. Messy but I think unavoidable.

--
Jim
"Josh Sale" <jsale@tril dot cod wrote in message
...
But Jim,

Do you know why (using your example) I can't just do a MsgBox Ctrl.ID?
Why doesn't Ctrl just late bind to the iRibbonControl object as it would
to any other object?

For reasons that go beyond the scope of this ng posting, my add-in does
need to compile without error under XL2003.

josh




"Jim Rech" wrote in message
...
This is what I do, Josh:

Sub BtnOnActionCall(Ctrl As Variant)
Dim Ctrl1 As IRibbonControl
Set Ctrl1 = Ctrl
MsgBox Ctrl1.ID ''Test

Since this sub is only called when run in Excel 2007 there is no problem
declaring Ctrl1 as IRibbonControl within the sub. If you try to compile
this project in Excel 2003 (Debug, Compile) you would get an error, but
there is no reason to do this.

--
Jim