How to know if a cell has an error in the formula in C#

Posted by Pascal on Stack Overflow See other posts from Stack Overflow or by Pascal
Published on 2010-03-11T12:06:32Z Indexed on 2010/03/11 20:34 UTC
Read the original article Hit count: 185

Filed under:
|
|

In an Excel formula you can use =ISERR(A1) or =ISERROR(A1)

In a VBA macro you can use IsError(sheet.Cells(1, 1))

But using a VSTO Excel Addin project I did not found similar function under the Microsoft.Office.Interop.Excel API.

My current workaround is to do this for all the existing error messages.:

if (((Range)sheet.Cells[1, 1]).Text == "#N/A" || ...)

Is there a better way to do this. I mean built in the API?

© Stack Overflow or respective owner

Related posts about vsto

Related posts about excel