title: Detect blank Excel cell using interop.excel in C#
body: <p>I'm trying to parse text from an Excel doc in C#. The problem is that I can't find a way to detect (and ignore) blank cells.</p>
  <p>I'm using Microsoft.Office.Interop.Excel in Visual Studio 2010 C#. I can't skip blank cells so my program will consequentially store blank values.</p>
  <hr />
  <p>I have defined my woorksheet the following way:</p>
  <p><code>Excel.Application exApp = OpenExcel(); String mySheet = @&quot;C:\sheet.xlsx&quot;; Excel.Workbook wb = exApp.Workbooks.Open(mySheet); Excel.Worksheet ws = wb.Sheets[1];</code></p>
  <p>I access my cells by <code>ws.Cells[row, col]</code>. And I've tried different approaches. To name a few:</p>
  <pre><code>ws.Cells[row, col].Value2 == null
  ws.Cells[row, col].Value == null
  ws.Cells[row, col].Value == &quot;&quot;
  </code></pre>
  <p>And also using the Range object explicitely
  <code>Excel.Range rng = ws.Cells[row, col]</code>
  To use <code>rng.Value2</code></p>
  <p>Depending on which approach I use I get different errors, Exception from HRESULT: 0x800A03EC is one of them.</p>