0
votes

Is it possible to set an excel 2010 built in RibbonButton to enabled=false from an excel VSTO Add-In?

1

1 Answers

1
votes

Here is a sample for Word, using Ribbon XML. I don't think you can use the ribbon designer for this. The same thing should work in Excel as well.

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <commands>
    <command idMso="Font" enabled="false" />
  </commands>
</customUI>

This disables the command, which includes not just the buttons in the ribbon, but also any other way it could be triggered, e.g. through a keyboard shortcut.

If you want to do anything more specific you may have to re-create standard ribbons or ribbon groups. E.g. you can't just disable Font while leaving all other placements enabled. You would have to hide the standard Home tab and re-create it but with your specific changes (disabled, missing, etc.).