Customize Ribbon with IdMso Excel Add-in with code example

Customize Ribbon with IdMso Excel Add-in with code example

IdMso

Provides a unique name which is used to customize Ribbon or its controls. In office each Button, Group, Menu, Ribbon has a unique IdMso which can be used to access it or customized. I have attached a complete list of IdMso which can be downloaded from here. Let’s understand an example where IdMso plays crucial role. In this example we will hide Sheet Rename command from Format Menu from Cells group on Home Tab.

Prerequisites

  • Access to Ribbon.xml of your add-in
  • Should have a XML editor

Code example

<ribbon>
    <tabs>
        <tab idMso="TabHome">
            <group idMso="GroupCells" visible="false"/>
        </tab>
    </tabs>
</ribbon>

if you notice I am using idMso of Home Tab which is “TabHome” then I have take the idMso of “GroupCells” and marked visible to false. if you run your solution and open Excel, you would not see Rename Sheet command under Home Tab >> Cells Group >> Format menu.

This way you can modify or override any command with the help of idMso. Next >> Handle FindRibbon task failed unexpectedly Add-in error

Leave a Reply

Your email address will not be published.