'Hide or Disable Save , Save As option in Excel

Currently we are using Office.Interop.Excel library to work on excel 2016 in WPF application. We are trying to hide or disable "Save" and "Save As" button due to some security risk in application. We tried below code to achieve it but somehow it is not working at all.

var toolbar = (Excel.Toolbar)Application.Toolbars["Standard"];

for(int index=1;index<toolbar.ToolbarButtons.Count;index++)
{
    if(toolbar.ToolbarButtons[index].Name=="Save")
    {
       toolbar.ToolbarButtons[index].Enabled=false;
    }


}

Please suggest if somehow we can achieve it.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source