title: Insert ComboBox programmatically inside the cell
body: <p>I want to insert object <code>curCombo</code> combo-box inside the active cell without defining widths and heights. In some of my test I worked this kind of principle, but I did not got that work as well</p>
  
  <pre><code>Set curCombo = ActiveSheet.Shapes.AddFormControl(.Left, .Top, .Width, .Height)
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>Sub comboBox1()
      Dim curCombo As Object
  
      '// Main challange is this set procedure here.
      Set curCombo = ActiveSheet.Shapes.AddFormControl(xlDropDown, _
      Left:=Cells(ActiveCell.Row, 3).Left, _
      Top:=Cells(ActiveCell.Row, 3).Top, Width:=100, Height:=20)
  
      With curCombo
          .ControlFormat.DropDownLines = 3
          .ControlFormat.AddItem "1", 1
          .ControlFormat.AddItem "2", 2
          .ControlFormat.AddItem "3", 3
          .Name = "myCombo" &amp; ER.Row
          '.OnAction = "myCombo_Change" &amp; ER.row
      End With
  End Sub
  </code></pre>