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

Tom:
Thanks for your help.
I noticed it is not at all working in either way. I was not tring the
dropdown --select way -- I took it granted that it is working.

what is happening is this:
My Popup is created in the previous file. when we are invoking that in this
file it is opening that file and trigering the OnAction function from that
file.

I am now deleting the PopUp in worksheet_beforeclose event. Now all is ok.
Thanks again for your support.
MVM


"Tom Ogilvy" wrote:

One other thought. Is it the same workbook all the time. If so, does the
workbook have a macro that executes when it opens. If you are triggering
some other control that has a macro assigned from this foreign workbook,
that would be the cause for it opening. How you are triggering that control
I can't say.

Also assume you are not creating a reference to that strange workbook.

--
Regards,
Tom Ogilvy

"MVM" wrote in message
...
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