Introduction: I wrote some short excel macros (checked, they work fine) and I want to link them to a button in the ribbon (Excel 2010). I successfully did this in Excel 2007. I use the Custom UI Editor to create a new feed that also works great. Everything is packaged in an .xlam add-in and added to Excel. The tape displays well, all other buttons work, but ...
Problem: when I click the button associated with the macro, I get the error: "the number of parameters is incorrect or the assignment of properties is invalid" (a message translated from Italian may not coincide with English)
Troubleshooting Information: Macros have no parameters. The same macros can be successfully called and executed manually. I can even add the same macros to the quick access toolbar.
Here is the specific part of the script tape:
<group id="DupNumber" label="Number" insertBeforeMso="GroupNumber" > <comboBox idMso="NumberFormatGallery"/> <box id="HN1" boxStyle="horizontal"> <buttonGroup id="HNButtonGroup1"> <button id="Euro" onAction="Roberto.xlam!EURZ" imageMso="F" supertip="text ..."/> <button id="EuroNZ" onAction="Roberto.xlam!EURNZ" imageMso="E" supertip="text ..."/> <button idMso="PercentStyle"/> <button id="Comma" onAction="Roberto.xlam!NewCommaFormat" imageMso="C" supertip="test ..."/> <button idMso="PercentStyle"/> </buttonGroup> </box>
and here are the macros:
Sub EURZ() Application.ActiveCell.NumberFormat = "โฌ #,##0.00" End Sub Sub EURNZ() Application.ActiveCell.NumberFormat = "โฌ #,##0" End Sub Sub NewCommaFormat() Application.ActiveCell.NumberFormat = "#,##0" End Sub
Can you help me? thanks roberto
excel ribbon
Bob Aug 18 '11 at 12:35 2011-08-18 12:35
source share