I have a class module where I am extending the functionality of the MSForms ComboBox in my Excel VBA project. I added the combo box reference to my class:
Private WithEvents cBox As ComboBox
I added a bunch of event handlers for this combo box including Enter event:
Private Sub cBox_Enter()
...
End Sub
This was working fine and suddenly at one point my Enter event stopped firing. So I started investigating and found that it is no longer listed as one of the events in my event list for "cBox". In fact other events are also missing. I did not do any changes in References when this happened. The last change I did before this happened is to comment out some of the events that I was not using to accomplish my functionality. Commenting them and restoring them did not bring back the Events. All of the missing event handlers are now listed as functions under the class itself (Ex. cBox_Enter)
Current list has:
BeforeDragOver
BeforeDroporPaste
Change
Click
DblClick
DropButtonClick
Error
KeyDown
KeyPress
KeyUp
MouseDown
MouseMove
MouseUp
However the same ComboBox control on the UserForm still lists all the missing events:
AfterUpdate (*)
BeforeDragOver
BeforeDroporPaste
BeforeUpdate (*)
Change
Click
DblClick
DropButtonClick
Enter (*)
Error
Exit (*)
KeyDown
KeyPress
KeyUp
MouseDown
MouseMove
MouseUp
Events with (*) above are missing in the class but present in the UserForm lists. I also went to the Object Browser and looked at the ComboBox Object and in the class browser those events are also missing.
Has anyone seen this before and knows how to get those events back in the class module?
NOTE: I am using Excel 2003
At the outset, do not have enough reputation to post as comment so posting as answer.
I observed that controls have less events and methods when used in worksheet than on user form, have tried this on empty sheet in 2003 and Office 365 on different systems.