title: Can't find a worksheet which exists
body: <p>I have a worksheet in Excel with the name "Control". I'm receiving a msgbox saying it doesn't exists. After I click on "OK" I get an error of "invalid call of function or procedure and the debugger stops in this function:</p>
  
  <pre><code>Private Sub ClearData(dataSheet As Worksheet)
      'On Error Resume Next
          'dataSheet.rows(DataRow1 &amp; ":" &amp; dataSheet.rows.Count).SpecialCells(xlCellTypeConstants).ClearContents
          Sheets(dataSheet).UsedRange.ClearContents
  End Sub
  </code></pre>
  
  <p>This function is used to clear the worksheet and the code before <code>'dataSheet.rows(DataRow1 &amp; ":" &amp; dataSheet.rows.Count).SpecialCells(xlCellTypeConstants).ClearContents</code> is commented because is raises error and I decided to modify to the line <code>Sheets(dataSheet).UsedRange.ClearContents</code> but the problem persists.</p>
  
  <p><strong>EDIT</strong> <code>ClearData</code> is called with this code:</p>
  
  <pre><code>Public Sub Init(rowNr As Integer, copyMap As CopyActionsMap, dataSheet As Worksheet)
  
      m_configRowNr = rowNr
      Set m_dataSheet = dataSheet
      m_dataRowNr = FindDataRow
      m_dataSheet.Cells(m_configRowNr, 1).Select 'select first cell in config row
      If (Not m_initialized) Then Set m_columnCopyConfigs = GetColumnCopyConfigs(copyMap) 'also sets m_count
      ClearData (m_dataSheet) 'Clean the existing data Now it says "object doenst support this method or property" after this: Private Sub ClearData(dataSheet As Worksheet) Sheets(dataSheet).Cells.Delete
  
  End Sub
  </code></pre>