Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MVM MVM is offline
external usenet poster
 
Posts: 53
Default commandbarCombobox problem

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default commandbarCombobox problem

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



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

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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default commandbarCombobox problem

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






  #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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default commandbarCombobox problem

I can't duplicate that situation. If it isn't firing the macro assigned,
then the keystroke must be going elsewhere.

Assuming you have not redefined it with OnKey, then I really can't say.
Assume you don't have any code anywhere in an open workbook which could
possibly open this other file. Perhaps unload any 3rd party addins,
unassign the macro, and have only open a single blank workbook and see if
you can reproduce it. If not, start adding things back.

In my testing, doing what you describes fires the assigned macro.

--
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








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default commandbarCombobox problem

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








  #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









Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Colon at the end of excel file name(ex: problem.xls:1, problem.xls financeguy New Users to Excel 2 January 15th 10 01:15 AM
Started out as an Access problem. Now an Excel problem RobertM Excel Discussion (Misc queries) 2 April 26th 06 07:30 PM
problem with a conditional max problem Brian Cornejo Excel Discussion (Misc queries) 1 February 18th 05 06:25 PM
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? OCI Excel Programming 0 May 16th 04 10:40 PM
CommandBarComboBox.AddItem - String Length Limit? Yishi Excel Programming 0 January 20th 04 07:21 PM


All times are GMT +1. The time now is 10:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"