View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
MVM MVM is offline
external usenet poster
 
Posts: 53
Default commandbarCombobox problem

Thank you Tom for being patient with me.
right click - drop the list -- select an item double click -- item is
copied to the cell. --- works fine as intended.

right click --click inside the combo control --high lights the item shown
in the control -- "ENTER" ---this opens onother file and don't do the
intended.

I put a stop in the GetCode procedure. It is not entering the function.
I have no clue how it is opening another file. Any suggestions are
appreciated.

Thanks
MVM


"Tom Ogilvy" wrote:

you asked:

on clicking inside
the combo control, it highlights the text in the combo control. If user

hits
enter, it opens another excel file.

.. . .
what event is fired on "ENTER" key. ?


The answer is: the macro assigned to the onaction property.

This works fine as said before.


Based on this statement I went back and carefully reread your posting. It
appeared to indicate that when the use clicked inside the combobox (the
entry was highlighted) and hit enter, it opens another excel file. Doing
this should fire the macro assigned to the onaction property. If that is
not the case and everything is working fine, then I am not sure why you are
posting.

--
Regards,
Tom Ogilvy


"MVM" wrote in message
...
Here is my OnAction procedure. This works fine as said before. I tried
stopping the code in this procedure. It is not getting into this

procedure
when I hit "Enter"

Public Sub GetCode()
Dim myControl As CommandBarComboBox
Application.EnableEvents = False
Set myControl =
Application.CommandBars("MyBar").FindControl(Type: =msoControlComboBox)
If myControl.ListIndex = 0 Then
MsgBox "Your entry is invalid. It is not in my list", vbCritical,
"Invalid Entry"
Application.EnableEvents = True
Exit Sub
End If
tRange.Cells(1, 1) = myControl.List(myControl.ListIndex)
Application.EnableEvents = True
End Sub

"Tom Ogilvy" wrote:

Check the onaction property of the control.

--
Regards,
Tom Ogilvy


"MVM" wrote in message
...
I have a short cut menu with one commandbarCombobox control.
user right clicks on a cell, short cut menu appears with combo

control.
clicking on the arrow opens the list and chooses and item that sits

the
cell.
This works fine.

but..
on right clicking, shortcut menu with control appears. on clicking

inside
the combo control, it highlights the text in the combo control. If

user
hits
enter, it opens another excel file.

what is causing this? what event is fired on "ENTER" key. How do I

trap
this event?

Thanks
MVM