Way to override existing functionality of controls of a Ribbon like Enable/Disable, Hide/Unhide and so on. As we are aware each control on existing Excel Ribbon assigned a unique idMso (you can download available idMso from here). We can use idMso to override existing controls functionalities. In this article we will disable Bold button on Home tab.
Step 1: Create a file and save it as Macro Enabled Workbook as we need to write code to override Save action. In this example I have saved file as “CustomAddin.xlsm” which will look like as below:
Step 2: Rename file extension by putting dot (.) zip at the end as shown below (upon rename windows prompt a confirmation box, say OK)
Step 3: Open zip file in zip manager and create one folder “customUI” as shown below:
Step 4: Create a text file and copy paste below XML and save it as “customUI14.xml“:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"> <commands> <command idMso="Bold" enabled="false"/> </commands> </customUI>
Step 5: Open the location of the xml (created in step 4) and copy paste inside zip browser under “customUI” folder that we created in step 3 as shown below:
Step 6: Close zip browser and rename excel file back from “CustomAddin.xlsm.zip” to “CustomAddin.xlsm” and open file in Excel and notice Bold button:
Please leave your valuable comments!!!