title: Run-time error '1004': Method 'OLEObjects' of object'_Worksheet' failed
body: <p>Friend sent me a spreadsheet that they downloaded and have been using for a while, now anytime they click on a cell they get:<br>
  <code>Run-time error '1004': Method 'OLEObjects' of object'_Worksheet' failed.</code> </p>
  
  <p>I am getting the same error. I have absolutely zero knowledge of visual basic, so I figured while I try and figure out what is going on in the code I would post my error on here. Any help is appreciated. Thankyou.</p>
  
  <blockquote>
    <p>error debugger highlights the line  <strong><code>Set cboTemp = ws.OLEObjects("TempCombo")</code></strong></p>
  </blockquote>
  
  <pre><code>Private Sub Worksheet_SelectionChange(ByVal Target As Range)
      Dim str As String
      Dim cboTemp As OLEObject
      Dim ws As Worksheet
      Set ws = ActiveSheet
  
      Set cboTemp = ws.OLEObjects("TempCombo")
      On Error GoTo errHandler
  
      If Target.Column &lt;&gt; 3 Then
          If cboTemp.Visible = True Then
              With cboTemp
                  .Visible = False
                  .Top = 10
                  .Left = 10
                  '.ListFillRange = ""
                  .LinkedCell = ""
                  TempCombo.Value = ""
                  TempCombo.Clear
              End With
          End If
      End If
  
      On Error GoTo errHandler
      If Target.Column = 3 Then
          With cboTemp
              'show the combobox with the list
              .Left = Target.Left
              .Top = Target.Top
              .Width = Target.Width
              .Height = Target.Height + 5
              '.ListFillRange = ws.Range("pickdata").Address 
              'ws.Range("AB2", ws.Range("AB2").End(xlDown).Address).Address 
              ' ws.Range("AB2").End(xlDown).Address 
              ' ws.Range("AB2", "ab300").Address 
              ' ws.Range(str).Address
              .LinkedCell = Target.Address
              .Visible = True
          End With
          cboTemp.Activate
          TempCombo_Change 'force the combobox to fill
      End If
  
  exitHandler:
      Application.ScreenUpdating = True
      Application.EnableEvents = True
      Exit Sub
  errHandler:
      MsgBox Err.Number &amp; Err.Description
      GoTo exitHandler '   Application.EnableEvents = True
      Exit Sub
  End Sub
  
  
  Private Sub TempCombo_Change()
  Dim cboTemp As OLEObject
  Dim s As String, i As Long
  Dim rng As Range, cell As Range, j As Long, fullmatch As Boolean
  Dim ar() As String
  If TempCombo.ListIndex &gt;= 0 Then 'we have a selection
  
  Else
      'TempCombo.DropDown
  
      If pickdata Is Nothing Then
          SetPickData
      Else
          If LCase(Left(ActiveCell.Offset(0, 1).Value, 9)) = "cleanable" And activedbclean = False Then
              SetPickData
          Else
              If LCase(Left(ActiveCell.Offset(0, 1).Value, 9)) &lt;&gt; "cleanable"  And activedbclean = True Then
                  SetPickData
              End If
          End If
      End If
      Set rng = pickdata
      'Set cboTemp = ActiveSheet.OLEObjects("TempCombo")
      s = TempCombo.Value
      TempCombo.Clear
      i = 0
      For Each cell In rng
          ar = Split(s, " ", -1, vbBinaryCompare)
          j = 0
          fullmatch = True
          Do While j &lt;= UBound(ar) And fullmatch = True
              If InStr(1, LCase(cell.Value), LCase(ar(j)), vbTextCompare) &lt;= 0     Then
                  fullmatch = False
              End If
              j = j + 1
          Loop
          If fullmatch = True Then 'InStr(1, LCase(cell.Value), LCase(s), vbTextCompare) &gt; 0 Then
          'If InStr(1, LCase(cell.Value), LCase(s), vbTextCompare) &gt; 0 Then
              TempCombo.AddItem cell.Value
              'If s = "" Then
                  i = i + 1
              'End If
          End If
          If i &gt; 50 Then
              Exit For
          End If
      Next cell
      TempCombo.Enabled = False
      TempCombo.Enabled = True
      TempCombo.DropDown
  End If
  End Sub
  </code></pre>