chrisSpaceman
chrisSpaceman

Reputation: 249

Return #N/A error from ExcelDNA

I'm pretty new to excelDNA, so I may be missing something obvious. I'm trying to return a #N/A from an excelDNA UDF. The function I'm using (via 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 a #N/A. I can't just return the string "#N/A", as the Excel functions like iserror() won't work on it.

Replacing the ExcelErrorNA with any other error types, for example ExcelErrorDiv0 still yields the #VALUE.

Any help would be greatly appreciated

Upvotes: 4

Views: 3618

Answers (1)

chrisSpaceman
chrisSpaceman

Reputation: 249

Ok - it looks like you have to stop the ExcelDNA.Integration reference from copying locally to get this. Original thread I found here:

https://groups.google.com/forum/#!topic/exceldna/MeYq0-LiGLM

Upvotes: 2

Related Questions