2011-07-26 5 views
1

드롭 다운 및 버튼이있는 Excel 용 addin을 만들려고합니다.Excel addin in vs2010

버튼을 성공적으로 추가 할 수 있었지만 어떤 이유로 든 드롭 다운을 추가 할 수 없었습니다. 나는 리본 디자이너를 추가하고 더 많은 컨트롤을 추가하는 것을 사용하는 것이 더 간단라고 생각

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; 

를 구글에 좀 더 연구를하고 후 : 여기

는이 ThisAddIn_startup에 calld되고, 버튼에 대한 코드입니다 추가. 그러나 프로젝트를 실행할 때 리본을 Excel에서 볼 수 없습니다.

나는 이것을 위해 더 나은 해결책이 무엇인지 완전히 잃어버린다.

도움/링크를 보내 주시면 대단히 감사하겠습니다.

감사합니다.

답변

0
내가 라인을 변경하여 엑셀 추가 기능과 같은 솔루션을 사용할 수

,

_commandBar = Application.CommandBars.Add("button1", Office.MsoBarPosition.msoBarRight, missing, true); 

으로, 나는의 추가 기능에 많은 컨트롤을 추가 할 수있는 위치를 제거함으로써

_commandBar = Application.CommandBars.Add("button1", missing, missing, true); 

에 내가 원하는.

0

Excel 2007을 실행하는 경우 기본 Excel 메뉴 (왼쪽 상단의 큰 버튼)로 이동하여 개발자 리본을 활성화 한 다음 해당 대화 상자의 오른쪽 하단에 Excel 옵션 버튼이 있습니다. 거기에서 인기있는 항목으로 이동하여 리본에 개발자 탭 표시를 선택하십시오.

+0

시도해 보았습니다. – genericuser

+0

개발자 리본 탭이 표시되지 않거나 옵션이 표시되지 않았습니까? – James

+0

옵션이 없습니다. – genericuser