2013-04-14 6 views
0

참고 다음 문제는 모든 데이터, 매크로 및 기타 코드를 복사하여 새 통합 문서를 만들어 해결했습니다. 통합 문서를 "중단"시키는 원인에 대한 통찰력을 환영합니다!Excel/RibbonUI 메뉴 사용 안 함

저는 맞춤 리본이있는 파일을 가지고 있습니다. 나는 최근에 새 그룹을 새 메뉴에 추가했습니다. 첫 번째 그룹에서 복사되었으며 특정 항목이 제거되었습니다.

첫 번째 그룹 "라이브러리"와 모든 컨트롤이 예상대로 작동합니다. 그러나 "문서"그룹의 "documentmenu"메뉴는 회색으로 표시되며 이유를 파악할 수 없습니다!

getEnabled 및 일반 enabled 특성을 메뉴에 추가하려고 시도했지만 화재는 발생하지 않으며 메뉴의 포함 된 단추에 대한 getEnabled 이벤트도 발생하지 않습니다.

리본을 처음 열면 getLabel 이벤트가 발생하고 레이블이 올바르게 설정됩니다.

그룹과 모든 컨트롤을 "문서"없이도 이름을 다시 지정해 보았습니다.이 경우 어떻게 든 상충되지만 다시는 이동하지 않습니다.

누가 이런 일이 일어나고 있는지 알 수 있습니까?

다음은 전체 customui xml 파일입니다.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<customUI 
    onLoad="CustomUI.Ribbon_onLoad" 
    xmlns="http://schemas.microsoft.com/office/2009/07/customui"> 
    <ribbon> 
    <tabs> 
     <tab 
      id="Main" 
      label="Initech"> 
     <group 
      id="Library" 
      label="Library" 
      tag="Library" 
      centerVertically="true"> 
      <menu 
       id="LibraryMenu" 
       tag="Library" 
       image="gear" 
       getLabel="CustomUI.Menu_getLabel"> 
      <button 
       id="LibraryMenu_Open" 
       tag="Library" 
       label="Open Library" 
       imageMso="FileOpen" 
       getEnabled="CustomUI.Button_getEnabled" 
       onAction="CustomUI.Button_onAction" /> 
      <button 
       id="LibraryMenu_New" 
       tag="Library" 
       label="New Library" 
       imageMso="FileNew" 
       getEnabled="CustomUI.Button_getEnabled" 
       onAction="CustomUI.Button_onAction" /> 
      <menuSeparator 
       id="LibraryMenu_Separator0" /> 
      <button 
       id="LibraryMenu_Save" 
       tag="Library" 
       label="Save" 
       imageMso="FileSave" 
       getEnabled="CustomUI.Button_getEnabled" 
       onAction="CustomUI.Button_onAction" /> 
      <button 
       id="LibraryMenu_Close" 
       tag="Library" 
       label="Close" 
       imageMso="FileClose" 
       getEnabled="CustomUI.Button_getEnabled" 
       onAction="CustomUI.Button_onAction" /> 
      <button 
       id="LibraryMenu_Default" 
       tag="Library" 
       label="Set as Default" 
       imageMso="AcceptInvitation" 
       getEnabled="CustomUI.Button_getEnabled" 
       onAction="CustomUI.Button_onAction" /> 
      <menuSeparator 
       id="LibraryMenu_Separator1" /> 
      <button 
       id="LibraryMenu_Add" 
       tag="Library" 
       label="Add Component" 
       getEnabled="CustomUI.Button_getEnabled" 
       onAction="CustomUI.Button_onAction" /> 
      <button 
       id="LibraryMenu_Editor" 
       tag="Library" 
       label="Edit Menu" 
       getEnabled="CustomUI.Button_getEnabled" 
       onAction="CustomUI.Button_onAction" /> 
      </menu> 
      <dynamicMenu 
       id="LibraryComponents" 
       tag="Library" 
       image="book_stack" 
       getLabel="CustomUI.Menu_getLabel" 
       getEnabled="CustomUI.Menu_getEnabled" 
       getContent="CustomUI.Menu_getContent" /> 
     </group> 
     <group 
      id="Document" 
      label="Document" 
      tag="Document" 
      centerVertically="true"> 
      <menu 
       id="DocumentMenu" 
       tag="Document" 
       imageMso="FileOpen" 
       getLabel="CustomUI.Menu_getLabel"> 
      <button 
       id="DocumentMenu_Open" 
       tag="Document" 
       label="Open Document" 
       imageMso="FileOpen" 
       getEnabled="CustomUI.Button_getEnabled" 
       onAction="CustomUI.Button_onAction" /> 
      <button 
       id="DocumentMenu_New" 
       tag="Document" 
       label="New Document" 
       imageMso="FileNew" 
       getEnabled="CustomUI.Button_getEnabled" 
       onAction="CustomUI.Button_onAction" /> 
      <menuSeparator 
       id="DocumentMenu_Separator0" /> 
      <button 
       id="DocumentMenu_Save" 
       tag="Document" 
       label="Save" 
       imageMso="FileSave" 
       getEnabled="CustomUI.Button_getEnabled" 
       onAction="CustomUI.Button_onAction" /> 
      <button 
       id="DocumentMenu_Close" 
       tag="Document" 
       label="Close" 
       imageMso="FileClose" 
       getEnabled="CustomUI.Button_getEnabled" 
       onAction="CustomUI.Button_onAction" /> 
      </menu> 
     </group> 
     </tab> 
    </tabs> 
    </ribbon> 
</customUI> 

세드릭 알아 내려고 노력에 대한 재생 시간 후에 업데이트, 내 통합 문서에 몇 가지 방법을 손상 밝혀졌습니다. 새로운 통합 문서에 코드를 삽입하면 코드가 제대로 작동합니다.

답변

0
  1. centerVertically는 유효한 속성이 아닙니다. 친절이 link

  2. getEnabled = "CustomUI.Button_getEnabled"&의 OnAction = "CustomUI.Button_onAction"
    기간을 피를 참조하십시오.은 콜백 함수의 이름으로 CustomUI.Button_getEnabled와 같은 하위/함수를 정의 할 수 없습니다.

3 버튼에 getEnabled 속성을 사용하면 응용 프로그램이 버튼의 활성화 상태를 결정해야 할 때 콜백 함수를 호출해야합니다.

sample code - getEnabled for ribbion

+0

centreVertically가 customui.14 스키마의 유효한 그룹 속성입니다 http://msdn.microsoft.com/en-us/library/documentformat.openxml.office2010.customui.group.centervertically.aspx 및 내 서브 시스템의 기간이 작동하면 서브 시스템이있는 모듈 이름을 지정할 수 있습니다. (VBA에만 해당 될 수 있음). – NickSlash

+0

@NickSlash 정보를 제공해 주셔서 감사합니다. – Santosh