title: Programmatically create event listener in VBA
body: <p>Is it possible to programmatically create an <code>event method</code> on a <code>comboBox</code>?</p>
  
  <p>On worksheet I have a <code>ComboBox</code> and I can get its names by code:</p>
  
  <pre><code>       Dim ole As OLEObject
         For Each ole In ActiveSheet.OLEObjects
  
         If TypeName(ole.Object) = "ComboBox" Then
         ' ole.Name '&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; here 
         End If
         Next ole
  </code></pre>
  
  <p>How can I now create and assign an <code>event method</code> for <code>ole.Name</code>:</p>
  
  <pre><code> Private Sub myComboBox_Change()
     ...
   End Sub
  </code></pre>
  
  <p>In Java it can be done with: <code>myComboBox.setOnChangeListener(...some code of listener interface...)</code> ;)</p>