Exception of type 'ExcelDna.Integration.XlCallException' was thrown

Jan 13, 2015 at 2:37 AM
Hi govert

I am getting a exception Exception of type 'ExcelDna.Integration.XlCallException' was thrown at
 return XlCall.Excel(XlCall.xlUDF, "Resize", ExcelAsyncUtil.Run("GetFinancialData", new object[] { "Statement" },
                        delegate
                        {
                            return DataFetcher.GetFinancialData("GetData", l_dictArgs);
                        }));
I tried clubbing Resize function and my function so that the array which I receive should resize according to the data size

the exception is thrown when I load the excel and sheet recalculates and my function is called .
Same thing when I call programatically by writing this formula on cell ,it works fine. any suggestion.

And One more thing ExcelAsyncUtil.Run calls the udf function 3 times.Why is this happening

Thanks and Regards
Mshakya
Coordinator
Jan 13, 2015 at 7:29 AM
Hi Mshakya,

The combination of async array functions and the array resizer does not work.
There have been attempts to figure out how to do this, and you can find the discussion here: https://groups.google.com/d/topic/exceldna/fCeH8wtGhFM/discussion
However, I don't have a satisfactory solution yet.

The Excel-DNA async support is built on Excel's RTD feature, which is a bit problematic for array functions. One side-effect is the multiple calls you see - one per cell plus one overall. There might be some ways to improve the performance of this in future Excel-DNA versions.

So async with arrays is generally a bit problematic.

-Govert