Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA Button Click Event calls subroutine multiple times!

Status
Not open for further replies.

rveel

Programmer
May 8, 2000
5
US
Hello,

The subroutine associated with a Button Click Event under Excel 97 VBA executes itself repeatedly after the initial click. It does eventually stop after 50 or so iterations. The button is located on a form. I have reviewed my code closely and cannot find any reason for this. E.g., there are no loops in the subroutine.

VBA bug? Any ideas?

Thanks
 
rveel,
Without the code there is no way to assist you. You say there is no loop in the code, but what is it supposed to do and how does it know when it is done?


Bryan Meek
bmeek@pacbell.net
A "Solution Provider" in your corner gives you the personal attention you need to find the right technology solutions for your business.
 
Hello Bryan,

Thanks for your message. I isolated and worked around the problem today (see below) by replacing the two commented lines with the equivalent third line. I still do not understand the original behavior, but it appeared as if the commented lines generated additional CategoryComboBox_Click()events.

-Bob


*******************************************
Private Sub CategoryComboBox_Click()
Dim i As Single

'CategoryComboBox.BoundColumn = 0
'i = CategoryComboBox.Value
i = CategoryComboBox.listIndex

'other commented-out code

End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top