我想創建一個有下拉式和按鈕的excel插件。vs2010中的Excel插件
我成功地添加了按鈕,但由於某種原因,我無法將其添加到下拉菜單中。
這裏是按鈕的代碼,這是calld在ThisAddIn_startup:
try
{
_commandBar = Application.CommandBars["commandBar"];
_commandBar.Delete();
}
catch (ArgumentException e)
{
}
// Add a commandbar named Test.
_commandBar = Application.CommandBars.Add("button1", Office.MsoBarPosition.msoBarRight, missing, true);
// Add a button to the command bar and an event handler.
_firstButton = (Office.CommandBarButton)_commandBar.Controls.Add(
Office.MsoControlType.msoControlButton, missing, missing, missing, missing);
_firstButton.Style = Office.MsoButtonStyle.msoButtonCaption;
_firstButton.Click += new Office._CommandBarButtonEvents_ClickEventHandler(firstButton_ButtonClick);
_commandBar.Visible = true;
在谷歌做一些更多的研究後,我認爲這是簡單的添加功能區設計和使用,添加多個控件添加到加入。但是當我運行該項目時,我無法在excel上查看該功能區。
我完全失去了什麼是更好的解決方案。
任何幫助/鏈接將不勝感激。
謝謝!
我試過了,它不起作用 – genericuser
它不顯示開發人員功能區選項卡,或該選項不存在? – James
選項wasnt there .. – genericuser