Using RX with Manual Calculation Mode

Aug 23, 2013 at 2:36 PM
Hello,

I'm having issues getting my async operation to work properly when calculation mode is set to manual. The first time you hit F9 will call the onNext, but I find that I need to hit F9 a second time before it actually renders in the spreadsheet. Is there something I should be doing differently to have it both call the onNext and render at the same time.

Thanks,
Ryan
Coordinator
Aug 23, 2013 at 2:55 PM
Hi Ryan,

I think there are fundamental problems in making the RxExcel reactive extensions approach work with manual recalculation.
The Excel-DNA Rx support is built on Excel's RTD support, which is the best way to push data into Excel, but that doesn't always cooperate well with manual recalculation - as you see, the functions need to be recalculated to refresh properly.

If you are using Excel 2010+, you might look into the support (added subsequent to Excel-DNA 0.30) for Excel's native async functions. To try this, download the latest source check-in and see Distribution\Samples\Async\NativeAsync.dna. I suspect that works a bit better with manual recalculation, but it has other downsides and probably won't integrate into the reactive extensions push-based model easily.

I'm not sure Excel makes a one-size-fits-all solution possible, so you might have to experiment, or make different versions of your functions that fit different usage scenarios.

-Govert
Aug 23, 2013 at 3:03 PM
Thanks for the speedy response! I'll take a look at the NativeAsync.


-Ryan
Jun 27, 2014 at 2:53 PM
Hi, I'm getting the same problem using the CustomRegistration library, does that use the RTD or native method?
Coordinator
Jun 27, 2014 at 3:03 PM
The CustomRegistration project includes transformations that create both the RTD-based and native async wrappers.

If your function immediately returns #N/A and later updates with the new value, it is using the RTD_based async. The native async does not complete the sheet calculation until all async functions have completed.

-Govert