like deactivating the option macro of excel from vsto

Fabro,

I hope can help me

the following line deactivates the option Macro of excel

((Office.CommandBarPopup)((Office.CommandBarPopup)this.Application.CommandBars[1].ControlsDevil).Controls[15]).Enabled = false;

But when the leaf has chart the option returns to appear.



Answer this question

like deactivating the option macro of excel from vsto

  • Wout

    The best place to ask this would be the excel.programming newsgroup, as that's where you'll find a large number of people who specialize in the Excel object model.

    FWIW, a Chart sheet has a different set of commandbars than a Worksheet sheet. So probably you have to make sure you disable the control on that commandbar, as well. But the Excel experts will know for sure.

    Also, using the numerical index to identify a commandbar and a control is very uncertain. The index may be quite different on another installation, where the user may have customized his environment. I recommend the FindControl method, using the ID parameter to identify the control you want to affect.



  • like deactivating the option macro of excel from vsto