title: can't find a way to handle events on Msforms.combobox from oleobject
body: <p>I hope you're doing well</p>
  <p>I created dynamically a combobox, as following</p>
  <pre><code>Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  Dim oSh As Shape
  Set oSh = ActiveSheet.Shapes.AddOLEObject(Left:=Target.Left, Top:=Target.Top, Width:=Target.Width, Height:=Target.Height, ClassType:=&quot;Forms.ComboBox.1&quot;)
  With oSh.OLEFormat.Object
      Debug.Print .OLEType
      .Visible = True
      .Name = &quot;test&quot;
      .ListFillRange = &quot;Sheet1!C1:C&quot; &amp; Worksheets(&quot;Sheet1&quot;).Cells(Rows.Count, 3).End(xlUp).row
      .Activate
  End With
  </code></pre>
  <p>Next, I want to handle events for each combobox. So after searching on the net, the suitable solution was to create a class named <code>classe1</code>, which has the following code :</p>
  <pre><code>Option Explicit
  
  Public WithEvents cbEvents As MSForms.ComboBox
  Private Sub CbEvents_Enter()
      do something
  End Sub
  </code></pre>
  <p>And then in the main module, I added</p>
  <pre><code>Set objMyEventClass.cbEvents = oSh.OLEFormat.Object
  </code></pre>
  <p>I get an <code>incompatible type</code> error</p>
  <p>Can anyone help ? thanks</p>
  <p><strong>EDIT:</strong></p>
  <p>Thanks to the persons who comment, so when I change</p>
  <pre><code>Set objMyEventClass.cbEvents = oSh.OLEFormat.Object
  </code></pre>
  <p>to</p>
  <pre><code>Set objMyEventClass.cbEvents = oSh.OLEFormat.Object.Object
  </code></pre>
  <p>I have no longer errors, but I can't handle any event (I tired to change <code>_Enter</code> to <code>_Change</code> but it doesn't work)</p>