OaklandJim
Well-known Member
- Joined
- Nov 29, 2018
- Messages
- 878
- Office Version
- 365
- Platform
- Windows
I hacked my way to understanding the ribbon-related xml inside excel file. Winzip enables me to make a copy of, modify, replace customUI14.xml so I get that. A big realization for me, heheh.
First, I want to build my own customUI14.xml code (or file?) and use VBA to put it into (and remove or replace it) in a specific Excel file, eventually I want sheet-specific ribbons. Anyway, how does that -- interacting with the xml within the Excel file -- work? What might I read?
I DO have the RibbonX Visual Designer installed but cannot figger out how to use it to modify ribbon xml for an existing file? Any good resources?
Second, sooo basic...still cannot get subs to fire from checkbox elements. No ERROR messages so I presume that my subs are "recognized" but they won't do anything.
What simple concept(s) or code modification am I missing. I HAVE read stuff on-line, but often find what I read to be confusing. But this seems basic?
Action subs
First, I want to build my own customUI14.xml code (or file?) and use VBA to put it into (and remove or replace it) in a specific Excel file, eventually I want sheet-specific ribbons. Anyway, how does that -- interacting with the xml within the Excel file -- work? What might I read?
I DO have the RibbonX Visual Designer installed but cannot figger out how to use it to modify ribbon xml for an existing file? Any good resources?
Second, sooo basic...still cannot get subs to fire from checkbox elements. No ERROR messages so I presume that my subs are "recognized" but they won't do anything.
What simple concept(s) or code modification am I missing. I HAVE read stuff on-line, but often find what I read to be confusing. But this seems basic?
XML:
<!--RibbonX Visual Designer 2.33 for Microsoft Excel CustomUI14 . XML Code produced on 2020/01/01-->
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" >
<ribbon >
<tabs >
<tab
id="Tab1"
label="Primary Tools">
<group
id="group1"
label="Utilities"/>
<group
id="group2"
label="Sorting">
<checkBox
id="G1Checkbox1"
label="Sort Symbol"
getPressed="G1Checkbox1_OnPress"
onAction="G1Checkbox1_OnAction"/>
<checkBox
id="G1Checkbox2"
label="Sort Value"
getPressed="G1Checkbox2_OnPress"
onAction="G1Checkbox2_OnAction"/>
</group >
</tab >
</tabs >
</ribbon >
</customUI >
Action subs
VBA Code:
Sub G1Checkbox1_OnAction( _
ByRef control As IRibbonControl, _
ByRef pressed As Boolean)
MsgBox "G1Checkbox1_OnAction, Pressed = " & pressed
End Sub
Sub G1Checkbox1_OnPress( _
ByRef control As IRibbonControl, _
ByRef pressed As Variant)
MsgBox "G1Checkbox1_OnPress, Pressed = " & pressed
End Sub
Sub G1Checkbox2_OnAction( _
ByRef control As IRibbonControl, _
ByRef pressed As Boolean)
MsgBox "G1Checkbox2_OnAction, Pressed = " & pressed
End Sub
Sub G1Checkbox2_OnPress( _
ByRef control As IRibbonControl, _
ByRef pressed As Variant)
MsgBox "G1Checkbox2_OnPress, Pressed = " & pressed
End Sub