Invoke Excel error: Too many/few arguments for this formula

Add-in Express™ Support Service
That's what is more important than anything else

Invoke Excel error: Too many/few arguments for this formula
 
nwein




Posts: 577
Joined: 2011-03-28
In built-in Excel functions, if a user supplies too many or too few parameters for a formula, Excel will prompt an error dialog saying just that.
Is there a way to safeguard my XLL UDFs and use the same mechanism with ADX?
It can be done in an ugly way when there are too few parameters by comparing the method's signature with the values of the supplied parameters (trying to find Reflection.Missing values). How can I achieve this with too many parameters? Also, it would be nice to know if there's some other way of achieving this without manually checking each method's signature.
Thanks!
Posted 03 Jul, 2015 18:02:53 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Nir,

Using an Excel UDF to handle extra parameters passed in a call to UDF is impossible. This should be done outside of the UDF. You can rely on Excel; it doesn't provide a lot of information about this situation however. Also, you can use a COM add-in to check the parameters; in Excel 2013 however, I get the SheetChange event called *after* the UDF is called. That is, you can let Excel handle this situation and provide the user with extra info using the COM add-in.


Andrei Smolin
Add-in Express Team Leader
Posted 06 Jul, 2015 10:38:00 Top
nwein




Posts: 577
Joined: 2011-03-28
Interesting, thanks for the info.
Posted 07 Jul, 2015 09:59:06 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
You are welcome.


Andrei Smolin
Add-in Express Team Leader
Posted 08 Jul, 2015 06:55:04 Top