Being sick and tired of the new 2007 ribbon, and not entirely stupid to pay money for untilities that merely reproduce the standard 2003 toolbar in a non-customizable form, I set off to create a ribbon of my liking for Excel 2007.
This I did, using RibbonCustomizer to rearrange everything the way I liked, then pasted the resulting xml code into MSO2007 Custom UI Editor and saved it into an .XLAM file.
Aside from the ribbon, I have two macros there for invoking functions not readily available in the .XLAM's module:
Option Explicit
Sub FilterByCurrentSelection()
On Error Resume Next
ActiveSheet.Range(ActiveCell.Address).AutoFilter Field:=1, Criteria1:=ActiveCell.Value
End Sub
Sub CenterAcrossSelection()
On Error Resume Next
With Selection
.HorizontalAlignment = xlCenterAcrossSelection
End With
End Sub
They run fine if saved in a workbook. But when I, having loaded the XLAM add-on, click on the corresponding RibbonUI buttons, the macros don't run with the error "Wrong number of arguments or invalid property assignment".
This happens even if I comment out all the code and put something harmless there, like msgbox "test".
The onaction statements in xml look valid to me (though I am, indeed, a layman):
<button id="Custombutton726353990" onAction="CenterAcrossSelection" imageMso="AsianLayoutFitText" showLabel="false" label="Center Across Selection" />
<button id="Custombutton889990873" onAction="FilterByCurrentSelection" imageMso="FilterBySelection" showLabel="false" label="Filter by current selection" />
Now the million-dollar question:
How do I make the macros run via the RibbonUI custom buttons?
PS BTW had no such problems with MS Word 2007 and its .DOTM</FONT>
This I did, using RibbonCustomizer to rearrange everything the way I liked, then pasted the resulting xml code into MSO2007 Custom UI Editor and saved it into an .XLAM file.
Aside from the ribbon, I have two macros there for invoking functions not readily available in the .XLAM's module:
Option Explicit
Sub FilterByCurrentSelection()
On Error Resume Next
ActiveSheet.Range(ActiveCell.Address).AutoFilter Field:=1, Criteria1:=ActiveCell.Value
End Sub
Sub CenterAcrossSelection()
On Error Resume Next
With Selection
.HorizontalAlignment = xlCenterAcrossSelection
End With
End Sub
They run fine if saved in a workbook. But when I, having loaded the XLAM add-on, click on the corresponding RibbonUI buttons, the macros don't run with the error "Wrong number of arguments or invalid property assignment".
This happens even if I comment out all the code and put something harmless there, like msgbox "test".
The onaction statements in xml look valid to me (though I am, indeed, a layman):
<button id="Custombutton726353990" onAction="CenterAcrossSelection" imageMso="AsianLayoutFitText" showLabel="false" label="Center Across Selection" />
<button id="Custombutton889990873" onAction="FilterByCurrentSelection" imageMso="FilterBySelection" showLabel="false" label="Filter by current selection" />
Now the million-dollar question:
How do I make the macros run via the RibbonUI custom buttons?
PS BTW had no such problems with MS Word 2007 and its .DOTM</FONT>