PC Review


Reply
Thread Tools Rate Thread

Add Menus to Application.CommandBars["Cell"] C# without addin

 
 
Stumple
Guest
Posts: n/a
 
      18th Mar 2009
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
 
Reply With Quote
 
 
 
 
xiuzhu
Guest
Posts: n/a
 
      4th May 2009
i want to know, because i meet this problem too.
control Excel ,use C# , winform

"Stumple" wrote:

> 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

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Menus to Application.CommandBars["Cell"] C# without addin Stumple Microsoft Excel Programming 0 18th Mar 2009 10:21 PM
Add Menus to Application.CommandBars["Cell"] C# without addin Stumple Microsoft Excel Programming 0 18th Mar 2009 10:19 PM
Like '.CommandBars("Cell")' in Page Break Preview AH·C Microsoft Excel Programming 11 30th Jan 2006 03:08 PM
It's not CommandBars("Cell"), right-click menu! =?Utf-8?B?VGV0c3V5YSBPZ3VtYQ==?= Microsoft Excel Programming 1 4th Jul 2005 07:02 AM
save and restore "Workbook Menu Bar" & "Cell" menus =?Utf-8?B?SmVmZiBIaWdnaW5z?= Microsoft Excel Programming 2 14th Feb 2005 01:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:58 PM.