title: How to reference ActiveX ComboBox in Excel 2016 VBA
body: <p>I've tried various solutions on here and elsewhere such as:</p>
  
  <pre><code>dim wb as workbook, ws as worksheet
  </code></pre>
  
  <hr>
  
  <pre><code>Dim cb As Object
  Set cb = ws.OLEObjects("ComboBoxViews")
  </code></pre>
  
  <p>or</p>
  
  <pre><code>ComboBoxViews
  </code></pre>
  
  <p>or</p>
  
  <pre><code>ws.comboboxviews
  </code></pre>
  
  <p>But all return Error 1004, the item with specified name wasn't found.  But it DOES exist, checking properties the name is very clearly 'comboboxviews'.</p>
  
  <p>Any ideas?</p>
  
  <p>EDIT:</p>
  
  <p>To make it clear for anyone else seeking help in the future and using Romcel's very helpful code as a base, it seems that in order to add items to an ActiveX ComboBox (which is my final goal), you need to reference it as an object:</p>
  
  <pre><code>Sub caller3()
  Dim ws As Worksheet
  Dim oleob As OLEObject
  Set ws = ThisWorkbook.Sheets("Sheet1")
  
  For Each oleob In ws.OLEObjects
    If TypeName(oleob.Object) = "ComboBox" Then
      oleOb.Object.AddItem "TEST"  &lt;&lt;&lt; CORRECT
      oleOb.AddItem "TEST"  &lt;&lt;&lt; INCORRECT
    End If
  Next
  
  End Sub
  </code></pre>