Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
error running macro from Ribbon button
Hi,
I've developed an application in v. 2007 that utilizes a lengthy wizard and runs without error when I run it directly from my VBE. Before I figured out Ribbons, I tried running it from a custom menu and it worked. Now I've created my custom tab, groups, buttons... on my ribbon, and it looks the way I want it. But when I try to run my macro from the custom button on the ribbon I get the following error: "Wrong number of arguments or invalid property assignment." I set the "OnAction" in the XML to the name of the subprocedure I want it to run. OK, I have tried everything. I've created a sub called "ExpenseHelp". The only thing in the sub is a msgbox "running program". I saved and closed it. In the Custom UI Editor I opened the macro-enabled file. I selected Microsoft's Sample "Custom Tab", and only changed the button's OnAction to "ExpenseHelp" and button label to "Expense Help". I verified it, saved it, opened the file in Excel. I see the custom tab and button. When I select the button, I get the same error! I've also tried saving it as an add-in, same thing. Am I somehow calling the macro incorrectly, or have it in the wrong location, or is there an update to Ribbonx I need? XML: <customUI xmlns="http://schemas.microsoft.com/office/2006/01/ customui" <ribbon startFromScratch="false" <tabs <tab id="customTab" label="Custom Tab" <group id="customGroup" label="Custom Group" <button id="customButton" label="Expense Help" imageMso="HappyFace" size="large" onAction="ExpenseHelp" / </group </tab </tabs </ribbon </customUI Excel file: sub ExpenseHelp() msgbox "running program" end sub help... please Debbie |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
error running macro from Ribbon button
Hi debbie
When you are in the UI editor click on the generate callbacks button. Looks like this then Sub ExpenseHelp(control as IRibbonControl) End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm wrote in message ... Hi, I've developed an application in v. 2007 that utilizes a lengthy wizard and runs without error when I run it directly from my VBE. Before I figured out Ribbons, I tried running it from a custom menu and it worked. Now I've created my custom tab, groups, buttons... on my ribbon, and it looks the way I want it. But when I try to run my macro from the custom button on the ribbon I get the following error: "Wrong number of arguments or invalid property assignment." I set the "OnAction" in the XML to the name of the subprocedure I want it to run. OK, I have tried everything. I've created a sub called "ExpenseHelp". The only thing in the sub is a msgbox "running program". I saved and closed it. In the Custom UI Editor I opened the macro-enabled file. I selected Microsoft's Sample "Custom Tab", and only changed the button's OnAction to "ExpenseHelp" and button label to "Expense Help". I verified it, saved it, opened the file in Excel. I see the custom tab and button. When I select the button, I get the same error! I've also tried saving it as an add-in, same thing. Am I somehow calling the macro incorrectly, or have it in the wrong location, or is there an update to Ribbonx I need? XML: <customUI xmlns="http://schemas.microsoft.com/office/2006/01/ customui" <ribbon startFromScratch="false" <tabs <tab id="customTab" label="Custom Tab" <group id="customGroup" label="Custom Group" <button id="customButton" label="Expense Help" imageMso="HappyFace" size="large" onAction="ExpenseHelp" / </group </tab </tabs </ribbon </customUI Excel file: sub ExpenseHelp() msgbox "running program" end sub help... please Debbie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
Running a Macro through a button vs. VBA | Excel Discussion (Misc queries) | |||
Running a Macro from a Command Button | Excel Programming | |||
Commandbar button running macro | Excel Programming |