title: Run Time Error '1004': Select method of Range Class failed using ThisWorkbook
body: <p>During the process of running a script if I manually remove focus from the Workbook containing the macro I get the error quoted. If I don't click on anything it works without issue. Script errors out only when I'm trying to place selection back into <code>A1</code> from the "Input" sheet. Break point is on following line:</p>
  
  <pre><code>ThisWorkbook.Sheets("Input").Range("A1").Select
  </code></pre>
  
  <p>If I debug and place focus back on macro Worksheet the script completes without issue. Previous line:</p>
  
  <pre><code>ThisWorkbook.Sheets("Input").Cells.Delete
  </code></pre>
  
  <p>runs without error so I'm guessing its the range that is falling out of scope but don't quite understand why as it should be defined by the previous scope notations.
  Can someone explain why that line is falling out of scope? Shouldn't the <code>ThisWorkbook</code> define fairly explicitly the Workbook that my code is referencing? Any guidance is greatly appreciated.</p>