+ Reply to Thread
Results 1 to 4 of 4

Populate dropDown in a custom ribbon on clicking a button

  1. #1
    Registered User
    Join Date
    11-30-2011
    Location
    India
    MS-Off Ver
    Excel 365
    Posts
    2

    Question Populate dropDown in a custom ribbon on clicking a button

    Hi All,

    I created a custom Tab in Excel 2010 Ribbon having a button and a dropDown. The XML I used looks like -

    PHP Code: 
    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
      <
    ribbon
        <
    tabs
          <
    tab id="MyTab" label="MyTab" insertBeforeMso="TabHome"
            <
    group id="Group1" label="My Group"
              <
    button id="Button1" label="Click Me" size="large" onAction="Macro1" /> 
              <
    dropDown id="dropDown1" label="Drop Down" /> 
            </
    group
          </
    tab
        </
    tabs
      </
    ribbon
    </
    customUI
    What I want to achieve is to write some code in Macro1 that will populate values One, Two, Three in the dropDown when Button1 is clicked. That means when the xlsm file is opened dropDown would be empty. It will be populated with values only when button is clicked.
    Can any of you write a code snippet to get this done? Does this also need changes to be made to the XML (like adding callback actions)?

    I used "Custom UI Editor for Microsoft Office" to add the xml to xlsm file.

    Thanks in advance. Eagerly waiting for the answer.
    - John

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Populate dropDown in a custom ribbon on clicking a button

    Hi johnjacobt
    Welcome to the forum
    Andy has created this add-in
    http://www.andypope.info/vba/ribboneditor.htm
    to create ribbons
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    11-30-2011
    Location
    India
    MS-Off Ver
    Excel 365
    Posts
    2

    Re: Populate dropDown in a custom ribbon on clicking a button

    Thanks Pike!

    Though I had already created the custom tab and controls in it, I'm checking out Andy Pope's RibbonX Visual Designer. It looks promising from first looks.

    I'm also a big fan of Ron de Bruin. I'm referring some of his examples as well to figure our how I can accomplish what I have posted.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Populate dropDown in a custom ribbon on clicking a button

    Ron's dropdown example here should assist, in case you haven't seen it yet.
    Remember what the dormouse said
    Feed your head

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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