View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Andy Pope Andy Pope is offline
external usenet poster
 
Posts: 2,489
Default Ribbon Button not Working with my Referenced Workbook

Hi,

If you use the CustomUI editor to generate the callbacks you will see the
routine requires an Argument.
Have a read of Ron's explanation of how to use same code in both xl2007 and
previous versions

http://www.rondebruin.nl/compatiblemenu.htm

Cheers
Andy


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"RyanH" wrote in message
...
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