Hi Jiri,
1. You can wrap the async call in order to return anything else as the
'busy' value. If your function itself might return #N/A you might need
two wrappers. See this answer for more details:
https://groups.google.com/group/exceldna/browse_frm/thread/dedf10eb5ea4f100/4406fdc86a3ca1ad
2. Async functions should be no more volatile than regular functions -
they should only recompute if the sheet is being recomputed, or if one
of the inputs change. But if the async function has completed, and now
you recalculate the sheet or change an input, indeed the whole
(possibly slow) async call starts again. Caching the result is a good
way for you to control how often the possibly slow work should
actually be done. I'm happy to consider ideas on how this should work
better. Perhaps Excel-DNA must just add some support to easily cache
function calls?
Instead of the async functions, you might also look into the Reactive
Extensions support, which allows you full control on how new values
should be pushed to Excel and when the async observable should be
"completed". There are some details here:
http://exceldna.codeplex.com/wikipage?title=Reactive%20Extensions%20for%20Excel
-Govert
On Feb 10, 1:32 pm, Jiri Pik <
jiri....@googlemail.com> wrote:
> The asynchronous support is amazing but I found two issues with which I am not sure how to fix:
>
> 1. When the Async call is being made, the excel shows in the cell #NA - is it possible to change it to something like
> "Computing ..." or so? The problem with #NA is that it is misleading as the result of calculation, rather than the status, may be
> #NA
>
> 2. With Async function, the result is somehow super-volatile, as it is calculated and as soon as the result pops up, the cell
> becomes #NA and it starts all over again. I have solved with using a cache of calced values but is there a better way?
>
> smime.p7s
> 8KViewDownload