The allowed function parameter and return types are:
DoubleStringDateTime-- returns a double to Excel (maybe string is better to return?)Double[]-- if only one column is passed in, takes that column, else first row is takenDouble[,]ObjectObject[]-- if only one column is passed in, takes that column, else first row is takenObject[,]Boolean(bool) -- returns an Excelbool(maybe string is better to return to Excel?)Int32(int)Int16(short)UInt16(ushort)DecimalInt64(long)
incoming function parameters of type Object will only arrive as one of the following:
DoubleStringBooleanExcelDna.Integration.ExcelErrorExcelDna.Integration.ExcelMissingExcelDna.Integration.ExcelEmptyObject[,]containing an array with a mixture of the above typesExcelReference-- (Only ifAllowReference=trueinExcelArgumentAttributecausingRtype instead ofP)
function parameters of type Object[] or Object[,] will receive an array containing a mixture of the above types (excluding Object[,])
return values of type Object are allowed to be:
DoubleStringDateTimeBooleanDouble[]Double[,]Object[]Object[,]ExcelDna.Integration.ExcelErrorExcelDna.Integration.ExcelMissing.Value-- Converted by Excel to be 0.0ExcelDna.Integration.ExcelEmpty.Value-- Converted by Excel to be 0.0ExcelDna.Integration.ExcelReferenceInt32 (int)Int16 (short)UInt16 (ushort)DecimalInt64 (long)
Otherwise return #VALUE! error
Return values of type object[] and object[,] are processed as arrays of the type object, containing a mixture of the above, excluding the array types.
Special return values
The following invalid return values, are returned to Excel as indicated
Object[0]=>#VALUEObject[0.0]=>#VALUEString.Empty=>""ExcelEmpty.Value=>0null=>#NUM