Consulting

Results 1 to 9 of 9

Thread: Custom UI Editor - how do I add a group to tab created in a different workbook ?

  1. #1
    VBAX Regular
    Joined
    Oct 2021
    Posts
    12
    Location

    Custom UI Editor - how do I add a group to tab created in a different workbook ?

    I just started with Office Ribbon Editor to include a custom tab on my ribbon. The idea is to have buttons from various workbooks (later to be converted to add-ins) on the SAME custom tab.

    The creation of the tab with the first button group worked fine ... see XML code below :

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <customUI xmlns=(note this is redacted because the forum apparently denies posts with URL's in them ... it contains the URL to the 2006-01 custom schemas)>
    <ribbon>
    <tabs>
    <tab id="piAddIns" label="pi Add-ins" insertAfterMso="TabHome" >
    <group id="piGeneralSettings" label="General Settings" >
    <button id="piRegistration" label="Registration" size="large" onAction="UpdateRegistrationSettings" imageMso="AccountSettings" />
    <button id="piLanguage" label="Language" size="large" onAction="SelectLanguage" imageMso="MailMergeRecepientsUseOutlookContacts" />
    </group>
    </tab>
    </tabs>
    </ribbon>
    </customUI>
    The problem I have is to then in ANOTHER workbook add XML code that will add that workbook's button to this "new" tab that I just created (called "piAddIns"). I tried XML code below (with variants of id, idQ and idMSO) to no avail. If I could get some help to figure this out (or pointers to what I'm doing wrong), that would be fantastic ...

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <customUI xmlns= (note this is redacted because the forum apparently denies posts with URL's in them)>
    <ribbon>
    <tabs>
    <tab idQ="piAddIns" label="pi Add-ins" >
    <group id="piDatePicker" label="Date Picker" insertAfterQ="piGeneralSettings" >
    <button id="piPickDate" label="Pick a Date" size="large" onAction="DatePickerMacro" imageMso="CalendarsGallery" />
    </group>
    </tab>
    </tabs>
    </ribbon>
    </customUI>
    Last edited by Paul_Hossler; 10-20-2021 at 09:35 AM. Reason: Lay-out not OK

  2. #2
    VBAX Mentor
    Joined
    Dec 2008
    Posts
    404
    Location
    Below is a simple example for three files. Separate groups are created in all three files, but in the third file a button is added to the group of the first file.
    1st file:
    <customUI  xmlns="http://schemas.microsoft.com/office/2006/01/customui"
                xmlns:nsWb1="My Shared Tab">
        <ribbon
            startFromScratch="false">
            <tabs >
                <tab 
                    idQ="nsWb1:QMySharedTab"
                    insertBeforeMso="TabHome"
                    label="My Shared Tab" >
                    <group 
                        idQ="nsWb1:QGroup1"
                        label="Group 1"
                        visible="true">
                        <button 
                            id="Button1"
                            label="Button1 in Group1"
                            visible="true"
                            onAction="Button1_onAction"/>
                    </group >
                </tab >
            </tabs >
        </ribbon >
    </customUI >
    2nd file:
    <customUI  xmlns="http://schemas.microsoft.com/office/2006/01/customui"
                xmlns:nsWb2="My Shared Tab">
        <ribbon
            startFromScratch="false">
            <tabs >
                <tab 
                    idQ="nsWb2:QMySharedTab"
                    insertBeforeMso="TabHome"
                    label="My Shared Tab" >
                    <group 
                        idQ="nsWb2:QGroup2"
                        label="Group 2 from Wkb2"
                        visible="true">
                        <button 
                            id="Button2"
                            label="Button2 in Group2"
                            visible="true"
                            onAction="Button2_onAction"/>
                    </group >
                </tab >
            </tabs >
        </ribbon >
    </customUI >
    3th file:
    <customUI  xmlns="http://schemas.microsoft.com/office/2006/01/customui"
                xmlns:nsWb3="My Shared Tab">
        <ribbon
            startFromScratch="false">
            <tabs >
                <tab 
                    idQ="nsWb3:QMySharedTab"
                    insertBeforeMso="TabHome"
                    label="My Shared Tab" >
                    <group 
                        idQ="nsWb3:QGroup3"
                        label="Group 3 from Wkb3"
                        visible="true">
                        <button 
                            id="Button3"
                            label="Button3 in Group3"
                            visible="true"
                            onAction="Button3_onAction"/>
                    </group >
                    <group 
                        idQ="nsWb3:QGroup1"
                        label="Group 1"
                        visible="true">
                        <button 
                            id="Button4"
                            label="Button 4 from Wkb3"
                            visible="true"
                            onAction="Button4_onAction"/>
                    </group >
                </tab >
            </tabs >
        </ribbon >
    </customUI >
    Attached Files Attached Files

  3. #3
    VBAX Regular
    Joined
    Oct 2021
    Posts
    12
    Location

    Smile The answer I was looking for :-)

    Artik, this is EXACTLY what I was looking for. Thanks for your fast and to-the-point reply. I'll get working on this right away.

    I'm new to this forum, it's great to have such a success in using it from the start :-)

    As a tangential question ... could you help point me to the right way to include code with the nice lay-out like you did in posts on this forum ?

    Thanks again

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,702
    Location
    could you help point me to the right way to include code with the nice lay-out like you did in posts on this forum ?
    Just use the [#] icon to add [CODE] and [/CODE] tags

    Capture.JPG


    Paste your macro, etc. between them, or paste your code, selected it, and then the [#] icon

    Of course, if you're KB-oriented, you can type the tags
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  5. #5
    VBAX Mentor
    Joined
    Dec 2008
    Posts
    404
    Location
    I use two tools to build and edit the ribbon:
    1. RibbonX Visual Designer by Andy Pope
    2. Office RibbonX Editor by Fernando Andreu.


    And Paul explained to you how to post code on the forum.



    Artik

  6. #6
    VBAX Regular
    Joined
    Oct 2021
    Posts
    12
    Location
    Thanks, Paul. Probably should have been able to figure that out myself then ;-)

  7. #7
    VBAX Regular
    Joined
    Oct 2021
    Posts
    12
    Location
    Artik, thanks again for the feedback. RibbonX Editor is unfortunately not (yet) available for ARM-based system (I've been in touch with Fernando over Github on that topic), so until further notice I'm building the XML into the workbooks using Office Ribbon Editor (I'm running Win11 Insider Preview ARM on and M1 Mac).

  8. #8
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,702
    Location
    Quote Originally Posted by Artik View Post
    I use two tools to build and edit the ribbon:
    1. RibbonX Visual Designer by Andy Pope
    2. Office RibbonX Editor by Fernando Andreu.
    Artik

    Not a big deal, but the links for the descriptions are switched

    https://github.com/fernandreu/office-ribbonx-editor

    https://andypope.info/vba/ribboneditor_2010.htm
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  9. #9
    VBAX Mentor
    Joined
    Dec 2008
    Posts
    404
    Location

    Artik

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •