-
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Are you perhaps using a volatile function like =TODAY() as the input? Or are the dates in the left side hard coded? |
Beta Was this translation helpful? Give feedback.
-
OK, that's kind of 'by design' since the volatile function is recalculating after the cell updates, then your function starts calculating again. |
Beta Was this translation helpful? Give feedback.
-
Also if you have more than one function, you should be careful with that first parameter of ExcelAsyncUtil.Run where you have "Database Request". It must be different when called from different functions (used together with the parameter info in the second argument of Run). public static object EXCHANGERATE(double dateField)
{
ICurrencyClient currencyClient = AddIn.ServiceProvider.GetRequiredService<ICurrencyClient>();
if (ExcelAsyncUtil.Run( "Database request" , dateField, delegate
{ I'd suggest public static object EXCHANGERATE(double dateField)
{
ICurrencyClient currencyClient = AddIn.ServiceProvider.GetRequiredService<ICurrencyClient>();
if (ExcelAsyncUtil.Run( nameof(EXCHANGERATE) , dateField, delegate
{ |
Beta Was this translation helpful? Give feedback.
OK, that's kind of 'by design' since the volatile function is recalculating after the cell updates, then your function starts calculating again.
Some usere make their own "=TODAY.NV()" function which just returns today but is not volatile. Another good approach is to cache such results (even for a short time), and check in the cache and return directly before calling
ExcelDnaUtil.Run
.