Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006

    Question Unanswered: msoControlComboBox query

    Some advice would be appreciated

    I have used command bar controls in my addins for some time now but only just begun using the combobox control.

    I can enter text in a combo box, hit enter when I press a command bar button, I can then run a sub which uses the value entered in the combo box.

    I use "commandbarname" .text to get the value from the combo box

    My question is can the value entered in the combo box be passed to the sub without first pressing enter, or if this is not possible can an action be placed on the OnEnter event (if their is a one) of the commandbarcombobox as I have noticed the.on action event does not work for the combobox as it does for a commandbarbutton.

    Any help and advice would be appreciated.

  2. #2
    Join Date
    Jan 2004
    Jersey, UK
    Ron, if I understand you correctly you want to do something based on a selection in a combo box when the value changes, rather than changing the combo box value and then pressing Enter. The answer is yes you can fire an event from a value chosen in the combo box but I'm pretty sure you'd have to code it yourself in a Select Case or IF statement in VBA.

    If you're not familiar with VBA then this might not make much sense to you:

    E.G. in the ComboBoxes OnChange Event you would have code like this:

    SELECT CASE ComboBox.Value
    CASE 'go here'
    'do this
    CASE 'go there'
    'do that'

    I hope that makes sense.

    Regards - Andy

  3. #3
    Join Date
    Jul 2006
    Sorry if I wasn't clear, The query I have is with the commandbarcontrols combobox's, which as far as I can see doesn't have any events, for example commandbar buttons have an on action event to fire a sub when they are presed, I am familiar with VB. and have used it to creat ddins that use commandbar buttons

    eg if you type a font size in the fontsize combobox in excel then click somewhere on the sheet the font is not resized, you need to enter the font size then press enter or tab. to activate the value entered in the combobox

Posting Permissions

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