Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Ribbon Button not Working with my Referenced Workbook
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Ribbon Button not Working with my Referenced Workbook
Expanding on Andy's post...
I'm not sure what this means because my procedures that the control button calls does not require arguements. 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 "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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Alter ribbon button label on the fly? | Excel Programming | |||
changing the order of the ribbon button | Excel Discussion (Misc queries) | |||
no custom button in ribbon | Excel Programming | |||
Add strikethrough button to ribbon | Excel Discussion (Misc queries) | |||
Ribbon stopps working after Save | Excel Programming |