ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add Menus to Application.CommandBars["Cell"] C# without addin (https://www.excelbanter.com/excel-programming/425773-add-menus-application-commandbars%5B-cell-%5D-c-without-addin.html)

Stumple

Add Menus to Application.CommandBars["Cell"] C# without addin
 
I am hosting an excel application in my winforms project. When I try to
access the commandbars and add a control I get an undetailed failed exception.

attributeMenu =
this.Application.CommandBars["Cell"].Controls.Add(MsoControlType.msoControlButton, "Attribute", Type.Missing, Type.Missing, true);

I can only look at the commandbars and chaneg their properties and I am
unable to add to them. I had to add my menus inside of an excel macroworkbook
but I need to do this in C#. I can not use a vsto addin to do this either
because VSTO doesn't support hosting excel in a winforms application.

How might I add to the Commandbars in excel from C#?

Thanks


All times are GMT +1. The time now is 04:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com