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

前端 未结 2 750
一向
一向 2020-11-30 01:52

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 u

2条回答
  •  一生所求
    2020-11-30 02:39

    You can use the WorksheetFunction method:

    Globals.ThisAddIn.Application.WorksheetFunction.IsErr(...)
    

    or

    [Your Excel Object].WorksheetFunction.IsErr(...)
    

    The IsErr is semantically identical to the Excel worksheet function, only instead of the cell reference pass in the actual value - AFAIK.

提交回复
热议问题