CustomUI tab menu item error "Wrong number of arguments or invalid property"

hiici

New Member
Joined
Jul 14, 2017
Messages
14
Hi,

I created the following xml in my .xlam add-in file to load a new tab and menu which works but when I click the Icon, I get the mentioned error . I do not have a separate file open with a same named module which I read can cause this problem. The generate call back and validate identify no issues

Thanks for your help in advance !

HTML:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
 <ribbon startFromScratch="false">
  <tabs>
   <tab id="customTab" label="My Menu">
    <group id="customGroup" label="Header/Filter">
     <button id="customButton" label="Header/Filter" imageMso="HappyFace" size="large" onAction="HeaderFilter" />
    </group>
   </tab>
  </tabs>
 </ribbon>
</customUI>


As a sidenote, The same macro works fine under the Add-In tab using the below code but I would like it to be under my own tab
Code:
    Set cControl = Application.CommandBars("Worksheet Menu Bar").Controls.Add
         With cControl
            .caption = "Header/Filter"
            .DescriptionText = " "
            .HelpFile = "C:.txt"
            .TooltipText = "Toggle Header and Filters On/Off"
            .faceId = 9246
            .Parameter = 2
            .BeginGroup = True
            .Style = msoButtonIconAndCaption
'           .Style = msoButtonCaption
            .OnAction = "HeaderFilter"
         End With
 
Last edited by a moderator:

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
It sounds like you have got the declaration wrong for the HeaderFilter routine. It should take a ribbon control as an argument. (if you used the CustomUI editor, it would create the declaration line for you)
 
Upvote 0
That was it, I didn't think to go back and put the ribboncontrol declaration into the existing module.

thank you Rory!

mike
 
Upvote 0

Forum statistics

Threads
1,213,501
Messages
6,114,010
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top