I am working in C# on an Excel AddIn with ExcelDNA. I have an Excel worksheet with a UDF placed in a lot of cells as a "formula array" making an RTD request.
Since the request is huge, it is divided in several threads. Therefore the responses arrive asynchronously, in blocs of around 50 rows. The UI stays responsive at all time, no problem. The data arrive, more or less fast, that's not issue.
The issue is that when a response arrives, the cells are pretty randomly rerendered. If I see some cells's value changed it means that I got a response, thus a bloc of 50 rows is there. But the value becomes visible after a random time or when clicking or scrolling the table! It reminds me of a simple Winforms' control.Invalidate missing if you will. The random time needed to see the results depends on the number of pending response to be processed. When I test that with 400 rows, the problem is there but it would not really need to be addressed. With 2000 rows and 26 columns concerned though it is a big problem.
I tried to programmatically trigger some events on the Excel Application with no success. I changed some timeouts like the RTD.ThrottleInterval with no effect. Toggling ScreenUpdating eventually throws a COM exception (it may not like to be shaken to much). I even tried the evil Application.DoEvents just in case.
That sounds like a pretty classical use case and am surprised to not find any solution.
PS: Any lead to clarify the question appreciated.