+ Reply to Thread
Results 1 to 3 of 3

VBA / XML dropdown in ribbon

  1. #1
    Registered User
    Join Date
    08-26-2012
    Location
    amsterdam
    MS-Off Ver
    Excel 2003
    Posts
    34

    VBA / XML dropdown in ribbon

    Hi All,

    Hope somebody can help me out. I created (on basis of an example on internet) an excel file with a ribbon that contains three dropdown menu's. The dropdown works but somehow I can't fetch the chosen items from the dropdown in a variable (although I included some on action code which should take care of it).

    Doe somebody know how to change the code so that I can get the variable for example in a MSG box. See code for one drop down below
    and the file attached.

    Thanks in advance,

    Michiel

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: VBA / XML dropdown in ribbon

    Everything I've found only returns the Index of the item selected.

    So I change the XMl to
    PHP Code: 
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <customUI onLoad="ribbonLoaded" xmlns="http://schemas.microsoft.com/office/2006/01/customui">
        <ribbon startFromScratch="false">
        <tabs>
          <tab id="myTab" label="MyTab">
            <group id="myGroupDD" label="Has Dropdown">
                  <dropDown id="dd1" label="Dropdown" getItemCount="DDItemCount" getItemLabel="DDListItem" onAction="DDOnAction" getSelectedItemIndex="DDItemSelectedIndex"/>
            <dropDown id="dd2" label="Dropdown2" getItemCount="DDItemCount2" getItemLabel="DDListItem2" onAction="DDOnAction" getSelectedItemIndex="DDItemSelectedIndex2"/>
            <dropDown id="dd3" label="Dropdown3" getItemCount="DDItemCount3" getItemLabel="DDListItem3" onAction="DDOnAction" getSelectedItemIndex="DDItemSelectedIndex3"/>
    </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>
    and added a select case to use the index as a reference of the range.

    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    08-26-2012
    Location
    amsterdam
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: VBA / XML dropdown in ribbon

    Subtile solution David. It works smooth :-)

    Thanks very much.

    Michiel

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Ribbon Change based on Non-Ribbon Object
    By diakonos1984 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-07-2014, 01:18 PM
  2. [SOLVED] An alternative to the Add-Ins ribbon tab - Global Custom Ribbon Tab by Ken Puls
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-16-2014, 10:01 PM
  3. Populate dropDown in a custom ribbon on clicking a button
    By johnjacobt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-01-2011, 05:02 AM
  4. Ribbon - Multiple xlam adding into single Ribbon tab
    By gooopil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-09-2011, 03:40 PM
  5. Excel Ribbon dropdown
    By VWood in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-15-2010, 12:07 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1