T
TrendyProgrammer
Hi,
I'm experiencing some annoying problems with activex listbox controls
that I'm hoping someone with greater experience than I can help me
out with. I posted a similar message to this forum a while back but,
since I never got any really great hints, I greatly simplified the
issue and have decided to post it again!
I have an Excel spreadsheet that contains an embedded activex listbox
control. When the user makes a selection in the listbox, the
Listbox_Click() event is triggered more than twice when I
programmatically set the value of the listbox. In other words, the
sequence of events are as follows:
1. User makes a selection in the listbox
2. Listbox_Click() event fires once and runs to completion in most
situations. However, in certain circumstances, step2 repeats 5-6 times
when I set the value of the listbox programmatically! This occurs even
if the EnableEvents and EnableCalculation properties of the Application
and Sheet property are set to False.
3. Focus and control returned back to Excel spreadsheet containing the
control.
The code in the Click event is pretty simple:
Private Sub ListBox1_Click()
MsgBox "ListBox1 Click() Event Fired"
if ListBox1.Value = 0 Then
ListBox1.Value = 1
End If
End Sub
the selection is changed to the next row programmatically by changing
the value of the listbox. What's going on?
Relevant properties of the listbox are given below:
Name: LikeItemsListBox
Autoload: False
BoundColumn: 1
Enabled: True
LinkedCell:
Locked: True
Multiselect: 0-fmMultiSelectSingle
Textcolumn: -1
Value:
Any ideas?
Thanks a lot for your help.
Amit
I'm experiencing some annoying problems with activex listbox controls
that I'm hoping someone with greater experience than I can help me
out with. I posted a similar message to this forum a while back but,
since I never got any really great hints, I greatly simplified the
issue and have decided to post it again!
I have an Excel spreadsheet that contains an embedded activex listbox
control. When the user makes a selection in the listbox, the
Listbox_Click() event is triggered more than twice when I
programmatically set the value of the listbox. In other words, the
sequence of events are as follows:
1. User makes a selection in the listbox
2. Listbox_Click() event fires once and runs to completion in most
situations. However, in certain circumstances, step2 repeats 5-6 times
when I set the value of the listbox programmatically! This occurs even
if the EnableEvents and EnableCalculation properties of the Application
and Sheet property are set to False.
3. Focus and control returned back to Excel spreadsheet containing the
control.
The code in the Click event is pretty simple:
Private Sub ListBox1_Click()
MsgBox "ListBox1 Click() Event Fired"
if ListBox1.Value = 0 Then
ListBox1.Value = 1
End If
End Sub
two times: once when the user selects the first item, and second whenFrom the code, one would expect the Click event to be fired a total of
the selection is changed to the next row programmatically by changing
the value of the listbox. What's going on?
Relevant properties of the listbox are given below:
Name: LikeItemsListBox
Autoload: False
BoundColumn: 1
Enabled: True
LinkedCell:
Locked: True
Multiselect: 0-fmMultiSelectSingle
Textcolumn: -1
Value:
Any ideas?
Thanks a lot for your help.
Amit