를 사용하지 않는 경우 알 수있는 경우 알 필요가있다. 값을 반환하거나 저장하는 방법을 결정해야합니다. XML/Registry/CustomXML 등을 사용할 지 결정하십시오. 결정한 후에는 다음 단계를 수행하십시오.
리본 XML :
<checkBox id="cbStoreValue" label="MyCheckBox" getPressed="Function_Clicked" onAction="Function_Action" />
VBA 코드 :
Public Function Function_Clicked(control As IRibbonControl, ByRef pressed)
pressed = GetKey
End Function
Public Function Function_Action(control As IRibbonControl, pressed As Boolean)
Store pressed
End Function
Public Sub Store(value As Boolean)
'''write the code for storing the key, may be to an ini file, or registry or an external xml, custom xml or custom document property
End Sub
Public Function GetKey() As Boolean
'''write the code for getting the key back from the source which you might have used to store the value.
'''return the correct value here
GetKey = True ' or whatever you have selected previously
End Function
희망이 도움이 :)
카스 B
는 1 부, 나는이 저장 가능하다고 생각하지 않습니다를 어플리케이션의 체크 박스 값 사용자 정의 속성/etc로 저장할 수 있습니다. 커스텀 리본을로드하는 파일에서 (내가 잘못하면 다른 것들이 나를 교정 할 수있다.) 파트 2가 가능합니다. –
Part2 나는 그것이 가능하다고 생각하지만 당신이 당신의 체크 박스를 어떻게 추가 했느냐에 달려있다. workbook_open 이벤트가 추가되고 있습니까? 값을 저장하는 txt 또는 ini 파일을 항상 가질 수 있습니다. –