Determining actual args an Excel UDF was called with.

Posted by Frederick on Stack Overflow See other posts from Stack Overflow or by Frederick
Published on 2010-03-30T07:06:50Z Indexed on 2010/03/30 7:13 UTC
Read the original article Hit count: 415

Filed under:
|
|

I'm adding a user defined function to Excel with varargs-based signature in C++:

XLFUNCTIONIMP(MyFunction)(...);

When Excel calls MyFunction, it passes it 30 arguments regardless of how many the user entered in the sheet. The extraneous ones are blank strings.

MyFunction, however, is designed to accept empty string arguments. As a result, I cannot tell valid empty strings apart from the extraneous ones sent by Excel.

A solution could be to obtain the contents of the actual cell where the user entered the function. However, I can't find a way of doing that from within the implementation of my function.

Could someone please suggest a way out?

© Stack Overflow or respective owner

Related posts about excel

Related posts about udf