Hi,
As far as I know, the behaviour of ExcelDna is exactly the same you'll
have in C. When you return a ExcelEmpty or ExcelMissing from your
function, I correctly build the corresponding XLOPER and return it to
Excel. If you return a null, a null pointer is returned directly to
Excel. So your function controls exactly what Excel receives,
equivalent to what you could return directly in C.
However, as long as a cell has a formula in, Excel will never consider
the cell to be empty. If the result of your function is ExcelMissing
or ExcelEmpty, Excel will evaluate the result as a 0, while a null is
converted to a #NUM error. So you have to return an empty string to
get a cell that is displayed as empty. Of course you can clear a cell
from a macro.
I'd be happy to look at it again if you can explain how to do so
'directly in C'.
Regards,
Govert