Error returning N / A from ExcelDNA

I am new to excelDNA, so I can skip something obvious. I am trying to return #N/Afrom excelDNAUDF. The function I'm using (through Visual Studio 2010) is below:

public static object returnError()
{
    return ExcelDna.Integration.ExcelError.ExcelErrorNA;
}

When called from an Excel worksheet, this returns a #VALUE- But I need #N/A. I cannot just return the string "# N / A", because Excel functions such as iserror()will not work on it.

Replacing ExcelErrorNAwith any other types of errors, for example ExcelErrorDiv0, still gives #VALUE.

Any help would be greatly appreciated.

+4
source share
1 answer

All Articles