title: How to know if a cell has an error in the formula in C#
body: <p>In an Excel formula you can use <code>=ISERR(A1)</code> or <code>=ISERROR(A1)</code></p>
  
  <p>In a VBA macro you can use <code>IsError(sheet.Cells(1, 1))</code></p>
  
  <p>But using a VSTO Excel Addin project I did not found similar function under the Microsoft.Office.Interop.Excel API.  I only want to know if there is an error in the cell, I'm not really interested in the type of error.</p>
  
  <p>My current workaround is to do this for all the existing error messages.:</p>
  
  <pre><code>if (((Range)sheet.Cells[1, 1]).Text == "#N/A" || ...)
  </code></pre>
  
  <p>Is there a better way to do this.  Is there a simple function in the API for that?</p>