none
Custom UI Editor RRS feed

  • Question

  • Hello

    I have a drop down on a custom ribbon The dropdown id=”dd1” . I want it that when the dropdown is clicked it auto-drops

    I've tried executing excel VBA with the OnAction and onChange Custom UI events, but they only fire after a drop-down element is selected.  Is there an Custom UI event that fires when the dropdown is clicked?

    The second issue I have is how do I refer to the drop down in the VBA?

    Thanks in advance

    Wednesday, December 6, 2017 4:12 PM

All replies

  • "I want it that when the dropdown is clicked it auto-drops"

    You should be using a combobox or dropdown control. The book that I use has an entire chapter devoted to them - they drop down and display their list when clicked.

    As to referring to them in VBA, you should get events created in the UI editor, like this, that will fire when the control is used:

    Sub rxitemdd1_getItemID(control As IRibbonControl, index As Integer, ByRef id)

    Wednesday, December 6, 2017 9:23 PM
  • Hello ryand09,

    I have tested combo box and drop down control, both of them could auto-drop item list once clicking the down arrow on the right. Which control are you using?

    What do you want to do via referring to the drop down? If you want to get its value, you could use a global variable to record its value in OnAction event. Once user selects the item in the drop down control, the global varibale will update and then you could get the current selected value.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, December 7, 2017 7:55 AM