C # VSTO Excel 2007 - disable hidden / hidden button

I am working on an Excel VSTO 2007 application. I was wondering if there is a way to disable the Hide and Unhide buttons present in the Excel View tab.

www.i.stack.imgur.com/vLfW5.png

edit: I'm looking for a way to do this programmatically using C # Code . Old vba might be useful. I searched a lot and did not find any specific solution.

+4
source share
2 answers

I use something like below to disable the delete sheet button, maybe something similar to what you want:

 Microsoft.Office.Tools.Excel.Worksheet.Worksheet excelShtBase; excelShtBase.Application.CommandBars["Ply"].Controls["&Delete"].Enabled = false; 
+2
source

I don’t think that you can disable the built-in controls in Excel 2007 onwards, unless you create your own ribbon controls with XML tape.

MSDN has many examples or tutorials, and here is one for you ( Show and hide tabs, groups, and controls on the Microsoft Office ribbon ).

+1
source

Source: https://habr.com/ru/post/1490503/


All Articles