Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Colon at the end of excel file name(ex: problem.xls:1, problem.xls | New Users to Excel | |||
Started out as an Access problem. Now an Excel problem | Excel Discussion (Misc queries) | |||
problem with a conditional max problem | Excel Discussion (Misc queries) | |||
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? | Excel Programming | |||
CommandBarComboBox.AddItem - String Length Limit? | Excel Programming |