Did I understood correctly that you can’t subscribe to an event other than using the VBA Editor’s control name + event name comboboxes? There is no combobox.change+=eventhandler syntax available as in other languages like C#, is there?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Correct. Event handling is done via naming convention in VB6/VBA.
The name can be the name of the control itlsef, or it can be a variable declared
WithEvents. By assigning this variable a different reference, you start receiving events from that new object. This can be seen as dynamical subscribing.However, certain environments can provide additional means. For example, in Excel some placeable objects have hidden properties, such as
Button.OnAction. You can assign a name of a macro to this property (as a string), and it will be called on button press.