Determining actual args an Excel UDF was called with.
- by Frederick
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?