EXCELlent Ribbonerz: 2nd set of eyes...why doesn't does my ribbon tab work?

OaklandJim

Well-known Member
Joined
Nov 29, 2018
Messages
833
Office Version
  1. 365
Platform
  1. Windows
Am regretting intent to roll-my-own ribbon maker. But, the sunk cost problem...

Have somewhat bare bones sub that creates xml based on entries in a worksheet table then adds it to a workbook, modifies the .rels file (if necessary) and then recreates the workbook via zipping with the xml inside. Wrx great...until it doesn't. I thought dev was over, but all of a sudden something went arwry. But I cannot tell what. It worked then it doesn't. The modifications to the workbook seemd perfect, now??? The file seems to have the correct stuff. I have a well vetted custom UI xml that I know works. The .rels file is modified, apparently correctly (it wuz wrking and I did not change anything since). I looked at the workbook and it seems the same as when ribbon was present.

The empty workbook with modifications made programmatically as a zip file is here.
EmptyWorkbook.xlsm.zip

So, what ribbon related detail am I missing?

My next question, assuming that I can get the ribbon to show up...how does one use worksheet event to enable or disable (show or hide) the ribbon as user moves among worksheets.

Oh yeah, I'm happy to share my "ribbon maker" workbook when I get it finalized if anyone cares. I put way too much into it so if can help others I'll be happy. I am not the killer coder though. Pros do not like my hyperexplicit coding (e.g. understandably named vars -- but names too long -- for many values). And, I often use long-winded approaches when other less windy (but unknown to me) are better. Etc.

Do rules allow me to post my email address? Should sharing be by link in thread?

Jim
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Another clue? When I open my file -- the one without my ribbon tab showing -- using RibbonX add-in -- all the controls show up and seem correctly defined.

So I know that my xml file is not an issue.

I double checked. I am adding a relationship to the _rels\.rels file. It too seems correct. Here is the complete tag from a misbehaving workbook.

<Relationship Id="cuID14" Type="http://schemas.microsoft.com/office/2007/relationships/ui/extensibility" Target="customUI/customUI14.xml"/>

Sheesh. So much wasted time if I cannot understand this. I suspect that I'll have to try to get smarter about ribboning to figger this out.

Also, if anyone wants it, FYI my workbook is somewhat limited as it only does the more common ribbon element types. So doing a super sophisticated ribbon is not doable here. I may add more element types but for now it does tab, group, separator, button, checkbox, togglebutton, dropdown (and dropdown item).

Have a great day!

Jim
 
Upvote 0
I guess I got ahead of myself. Workbook set up with RibbonX works great. I just got confused with so many test workbooks and thought that mine works. BUT, my xml seems eerily similar to to that from RibbonX. Any detail-oriented folks willing to see what might be different and that affects whether ribbon works?

Jim's XML

XML:
<!--Ribbon for Microsoft Excel CustomUI14. XML Code produced on Jan 6, 2020-->
<customUI  xmlns="http://schemas.microsoft.com/office/2009/07/customui" >
  <ribbon >
    <tabs >
      <tab
          id="tab1"
          label="Test Ribbon"
          insertBeforeQ="TabFormat">
         <group
               id="group1"
               label="Sorting"
               autoScale="true">
                <button
                       id="G1Button1"
                       label="Sort Symbol"
                       onAction="G1Button1_onAction"
                       imageMso="SortAscendingExcel"
                       screentip=""/>
                <button
                       id="G1Button2"
                       label="Sort Quantity"
                       onAction="G1Button2_onAction"
                       imageMso="SortAscendingExcel"
                       screentip=""/>
                <separator
                       id="G1Separator1"
                       label="Sort Separator" />
                <button
                       id="G1Button3"
                       label="Sort Value"
                       onAction="G1Button3_onAction"
                       imageMso="SortAscendingExcel"
                       screentip=""/>
                <button
                       id="G1Button4"
                       label="Sort Accounts"
                       onAction="G1Button4_onAction"
                       imageMso="SortDialogClassic"
                       screentip=""/>
                <toggleButton
                       id="G1Togglebutton1"
                       label="Sort None"
                       onAction="G1Togglebutton1_onAction"
                       imageMso="ObjectBringForward"
                       screentip=""/>
         </group >
         <group
               id="group2"
               label="Clear Data"
               autoScale="true">
                <button
                       id="G2Button1"
                       label="One Fund"
                       onAction="G2Button1_onAction"
                       imageMso="DeleteCells2"
                       screentip="Delete data for one fund identified using active cell."/>
                <button
                       id="G2Button2"
                       label="All Funds"
                       onAction="G2Button2_onAction"
                       imageMso="DeleteRows"
                       screentip="Delete data for all funds."/>
         </group >
         <group
               id="group3"
               label="Utilities"
               autoScale="true">
                <button
                       id="G3Button1"
                       label="Sticky Note"
                       onAction="G3Button1_onAction"
                       imageMso="AppointmentColor10"
                       screentip="Add a sticky note to the active worksheet."/>
                <button
                       id="G3Button2"
                       label="Clear Note"
                       onAction="G3Button2_onAction"
                       imageMso="AppointmentColor7"
                       screentip="Clear note from active cell."/>
                <button
                       id="G3Button3"
                       label="Freeze Panes"
                       onAction="G3Button3_onAction"
                       imageMso="FreezePanes"
                       screentip=""/>
         </group >
         <group
               id="group4"
               label="Toggle Visible"
               autoScale="true">
                <checkBox
                         id="G4Checkbox1"
                         label="Dates"
                         onAction="G4Checkbox1_onAction"
                         getPressed="G4Checkbox1_pressed"
                         screentip="Show/Hide dates column."/>
                <checkBox
                         id="G4Checkbox2"
                         label="Symbol"
                         onAction="G4Checkbox2_onAction"
                         getPressed="G4Checkbox2_pressed"
                         screentip="Show/Hide symbols column."/>
         </group >
         <group
               id="group5"
               label="Select Color"
               autoScale="true">
                <dropDown
                     id="G5Dropdown1"
                     label="Select Primary"
                     onAction="G5Dropdown1_onAction"
                     screentip="Select the preferred primary color.">
                        <item
                             id="G5Item1"
                             label="Blue"/>
                        <item
                             id="G5Item2"
                             label="Red"/>
                        <item
                             id="G5Item3"
                             label="Green"/>
                </dropDown >
         </group >
      </tab >
    </tabs >
  </ribbon >
</customUI >

RibbonX XML

XML:
<!--RibbonX Visual Designer 2.33 for Microsoft Excel CustomUI14 . XML Code produced on 2020/01/03-->
<!--
    Ribbon for Microsoft Excel CustomUI14. XML Code produced on
    Jan 3, 2020
-->
<customUI  xmlns="http://schemas.microsoft.com/office/2009/07/customui" >
    <ribbon >
        <tabs >
            <tab
                id="tab1"
                label="Test Ribbon">
                <group
                    id="group1"
                    label="Sorting"
                    autoScale="true">
                    <button
                        id="G1Button1"
                        imageMso="SortAscendingExcel"
                        label="Sort Symbol"
                        onAction="G1Button1_onAction"/>
                    <button
                        id="G1Button2"
                        imageMso="SortAscendingExcel"
                        label="Sort Quantity"
                        onAction="G1Button2_onAction"/>
                    <separator  id="G1Separator1" />
                    <button
                        id="G1Button3"
                        imageMso="SortAscendingExcel"
                        label="Sort Value"
                        onAction="G1Button3_onAction"/>
                    <button
                        id="G1Button4"
                        imageMso="SortDialogClassic"
                        label="Sort Accounts"
                        onAction="G1Button4_onAction"/>
                    <toggleButton
                        id="G1Togglebutton1"
                        imageMso="ObjectBringForward"
                        label="Sort None"
                        onAction="G1Togglebutton1_onAction"/>
                </group >
                <group
                    id="group2"
                    label="Clear Data"
                    autoScale="true">
                    <button
                        id="G2Button1"
                        imageMso="DeleteCells2"
                        label="One Fund"
                        screentip="Delete data for one fund identified using active cell."
                        onAction="G2Button1_onAction"/>
                    <button
                        id="G2Button2"
                        imageMso="DeleteRows"
                        label="All Funds"
                        screentip="Delete data for all funds."
                        onAction="G2Button2_onAction"/>
                </group >
                <group
                    id="group3"
                    label="Utilities"
                    autoScale="true">
                    <button
                        id="G3Button1"
                        imageMso="AppointmentColor10"
                        label="Sticky Note"
                        screentip="Add a sticky note to the active worksheet."
                        onAction="G3Button1_onAction"/>
                    <button
                        id="G3Button2"
                        imageMso="AppointmentColor7"
                        label="Clear Note"
                        screentip="Clear note from active cell."
                        onAction="G3Button2_onAction"/>
                    <button
                        id="G3Button3"
                        imageMso="FreezePanes"
                        label="Freeze Panes"
                        onAction="G3Button3_onAction"/>
                </group >
                <group
                    id="group4"
                    label="Toggle Visible"
                    autoScale="true">
                    <checkBox
                        id="G4Checkbox1"
                        label="Dates"
                        screentip="Show/Hide dates column."
                        getPressed="G4Checkbox1_pressed"
                        onAction="G4Checkbox1_onAction"/>
                    <checkBox
                        id="G4Checkbox2"
                        label="Symbol"
                        screentip="Show/Hide symbols column."
                        getPressed="G4Checkbox2_pressed"
                        onAction="G4Checkbox2_onAction"/>
                </group >
                <group
                    id="group5"
                    label="Select Color"
                    autoScale="true">
                    <dropDown
                        id="G5Dropdown1"
                        label="Select Primary"
                        screentip="Select the preferred primary color."
                        onAction="G5Dropdown1_onAction">
                        <item
                            id="G5Item1"
                            label="Blue"/>
                        <item
                            id="G5Item2"
                            label="Red"/>
                        <item
                            id="G5Item3"
                            label="Green"/>
                    </dropDown >
                </group >
            </tab >
        </tabs >
    </ribbon >
</customUI >
 
Upvote 0

Forum statistics

Threads
1,214,656
Messages
6,120,762
Members
448,991
Latest member
Hanakoro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top