Argument type validation in the Function Wizard

2019-08-29 06:22发布

问题:

In Excel, the DATE function for example shows "=number" against each field.

If I enter a string in these fields in place of a number, I get the #VALUE! error.

Can similar functionality be achieved with Excel-DNA?

回答1:

I don't think Excel supports a way to show those types for user-defined functions. Excel-DNA registers functions with the right types (like taking a Double). Excel completely controls how things are displayed in the Function Arguments dialog, and some aspects only work for built-in functions, like having mandatory parameters (displayed in bold).