Ribbon Button not Working with my Referenced Workbook

R

RyanH

I have a workbook named "Global Schedule" that my users open with Excel
versions 2003 and 2007. I have a 2003 Add-In that I reference which contains
all of the code to manipulate the Global Schedule.

If 2003 opens the Global Schedule I have code to add a custom popup menu
with some control buttons. These buttons do custom sorts to the Global
Schedule. This part works beautifully.

If 2007 is used to open the Global Schedule then a 2007 Add-In is only used
to change the Ribbon which also contains custom buttons to do my custom
sorts. I want these buttons to call the same procedures that are located in
the referenced workbook - 2003 Add-In. Can I not call procedures from a
referenced workbook in XML? The problem happens when I click the Ribbon
control butttons. I get an Error: "Wrong Number of Arguements or Invalid
Property Assignment." I checked the XML code in the CustomUI Editor and the
buttons onAction has the correct procedure pointing to the 2003 Add-In
reference. I'm not sure what this means because my procedures that the
control button calls does not require arguements. Does anyone have any ideas?

Here is my basic setup:

'GLOBAL SCHEDULE CODE:
Private Sub Workbook_Open()

If Val(Application.Version) > 11 Then
' open 2007 Add-In which contains XML to change Ribbon
Else
Call CustomMenuControl(ThisWorkbook)
End If

End Sub

The 2003 Add-In is always open no matter which version of Excel is used
because it contains several modules that I reference to manipulate the Global
Schedule Data.
 
J

Jim Rech

Expanding on Andy's post...

But the procedure named in your RibbonX must have the arguments it expects.
Example:

In Ribbonx:

<button id="Btn1" label="Btn1" onAction="MyAddin.xla!BtnMac"/>

In MyAddin.xla:

Sub BtnMac(Ctrl As Variant) ''< must have this parameter
SubIReallyWantToCall
End Sub

Sub SubIReallyWantToCall()
.....
End Sub

--
Jim
|I have a workbook named "Global Schedule" that my users open with Excel
| versions 2003 and 2007. I have a 2003 Add-In that I reference which
contains
| all of the code to manipulate the Global Schedule.
|
| If 2003 opens the Global Schedule I have code to add a custom popup menu
| with some control buttons. These buttons do custom sorts to the Global
| Schedule. This part works beautifully.
|
| If 2007 is used to open the Global Schedule then a 2007 Add-In is only
used
| to change the Ribbon which also contains custom buttons to do my custom
| sorts. I want these buttons to call the same procedures that are located
in
| the referenced workbook - 2003 Add-In. Can I not call procedures from a
| referenced workbook in XML? The problem happens when I click the Ribbon
| control butttons. I get an Error: "Wrong Number of Arguements or Invalid
| Property Assignment." I checked the XML code in the CustomUI Editor and
the
| buttons onAction has the correct procedure pointing to the 2003 Add-In
| reference. I'm not sure what this means because my procedures that the
| control button calls does not require arguements. Does anyone have any
ideas?
|
| Here is my basic setup:
|
| 'GLOBAL SCHEDULE CODE:
| Private Sub Workbook_Open()
|
| If Val(Application.Version) > 11 Then
| ' open 2007 Add-In which contains XML to change Ribbon
| Else
| Call CustomMenuControl(ThisWorkbook)
| End If
|
| End Sub
|
| The 2003 Add-In is always open no matter which version of Excel is used
| because it contains several modules that I reference to manipulate the
Global
| Schedule Data.
| --
| Cheers,
| Ryan
 

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