CustomRegistration Async default return value

Jun 4, 2014 at 4:19 PM
Edited Jun 4, 2014 at 4:19 PM
Hi, is it possible to change the default return value in the CustomRegistration Async example from #N/A to another text string? I can't see where it's being set anywhere!
Coordinator
Jun 4, 2014 at 8:46 PM
The #N/A is the default return value from the internal RTD implementation underlying the async calls.

If your're making the wrappers that call ExcelAsyncUtil.Run(...) or ExcelAsyncUtil.Observe(...) yourself, then you can check the return value for ExcelError.ExcelErrorNA and return something else accordingly.

If you're using the CustomRegistration library to generate the wrappers for you, then you can either change the AsyncTaskUtil.RunTask methods to add the return value check. A more 'correct' approach would be to figure out how to make a more general ReturnValue conversion (this is likely to meed some understanding of the Expression stuff, since I doubt the existing code is quite right for adding this kind of extra conversion).

-Govert
Jun 9, 2014 at 11:39 AM
thanks for the response Govert! i'll look into that.

on a side note, I was hoping to replicate http://excel-dna.net/2011/01/30/resizing-excel-udf-result-arrays/ but using custom registration for my async call but how do I call XlCall.Excel(XlCall.xlUDF, "Resize", result); correctly from within an async function?
Coordinator
Jun 9, 2014 at 1:08 PM
I think you'll have to add an extra transformation to your CustomRegistration pipeline. Similar to the FunctionLoggingHandler in the Example project maybe, but adding the Resize call at the end.

-Govert