How to know if a cell has an error in the formula in C#
- by Pascal
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?