Hi Vincent,
I suggest you make two wrappers - one to change the #N/A return value
of your function to some other intermediate value, and the second to
change the ExcelAsyncUtil.Run return value again.
So you have:
private static object realAsyncFunction(string param)
{
// might return ExcelErrorNA
}
private static object safeReturnFunction(string param)
{
object result = realAsyncFunction(param);
if (result == ExcelError.ExcelErrorNA)
return "###NA###";
else
return result;
}
public static object excelAsyncFunction(string param)
{
object result = ExcelAsyncUtil.Run("excelAsyncFunction", param,
delegate { return safeReturnFunction(param); });
if (result == ExcelError.ExcelErrorNA)
return "#WAIT - Busy"; // Actually busy
else if (result == "###NA###")
return ExcelError.ExcelErrorNA; // Function returned #N/A
else
return result;
}
You should be able to wrap this in some utility function.
Do you think that would work?
-Govert
On Nov 29, 7:08 pm, Vincent Bouret <
vincent.bou...@gmail.com> wrote:
> Any way of changing the default wait return value of ExcelAsyncUtil.Run?
> Our regular process could return a ExcelErrorNA in some cases as the final
> result (and not just waiting for calculation's end).
>
> Vincent
> > > > Seehttps://
> >
groups.google.com/d/topic/exceldna/ezHtJyju_rQ/discussionfor
> > > > some more examples.