Search code examples
c#excelvstoribbon

Is it possible to remove parts from the Ribbon, in VSTO Excel C# Document-Level Customizations?


Is it possible to remove parts from the Ribbon, in VSTO Excel C# Document-Level Customizations?

For example, I want to disable the Data Tools group in the Ribbon.


Solution

  • Sure, you should be able to do

    1. Create a new Excel Workbook project
    2. Right click on solution - Add item = Ribbon XML
    3. follow the steps in the newly generated class
    4. edit the generated Ribbon.xml file like this

    <?xml version="1.0" encoding="UTF-8"?> <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load"> <ribbon> <tabs> <tab idMso="TabData" visible="false">
    </tab> </tabs> </ribbon> </customUI>

    When I run the project I can't see the Data tab in my Excel