How do i show "You've entered too few arguments for this function" message

349 views
Skip to first unread message

Beryl Wilson

unread,
Feb 3, 2014, 12:46:17 AM2/3/14
to exce...@googlegroups.com
Hi,

In excel functions like "SubTotal" i get "You've entered too few arguments for this function" message box when i give less than the required parameters. I don't get this message when i use my own function created using Excel DNA.

Please help.

Govert van Drimmelen

unread,
Feb 3, 2014, 4:27:12 AM2/3/14
to exce...@googlegroups.com
Hi Beryl,

With Excel's C API (which Excel-DNA uses to integrate with Excel) there' no way to indicate that a parameter is mandatory, so you won't get the message from Excel. However, you can deal with the situation inside your function.
If your parameter is set to be of type 'object', any missing values will be passed as ExcelMissing.Value. You can detect this and respond with a MessageBox, or by returning some information string as the result.

Regards,
Govert
Reply all
Reply to author
Forward
0 new messages