Static classes, functions without parameters

Apr 5, 2011 at 4:30 PM

Hi,

I have some UDFs presented via excelDNA, for example imagine a function "GetValue(param1, param").  A user has discovered that if they just type "=GetValue" in a cell, and no parameters or brackets, they get a number rather than an error!  Do you know what this is, and is there any way to show an error code?

Thanks,

Miles

Coordinator
Apr 5, 2011 at 4:56 PM

Hi Miles,

Indeed, calling the function with no brackets or parameters will return a number to the sheet - I presume it is some registration id.

This is true for all add-ins made with the .xll C API. In this case Excel never calls into the add-in, so I don't know of any workaround.

Regards,

Govert

Coordinator
May 9, 2011 at 11:39 AM

That registration ID can sometimes be useful. It allows you to put together functional-programming style formulae like:

=ARRAY.RUNNING(FUNCTION.MUL, ARRAY.SEQUENCE(1, 5))

(From http://www.wilmott.com/messageview.cfm?catid=10&threadid=63684.)

-G