How to process thousands of asyncronous functions?

Nov 18, 2013 at 8:46 AM

I need to write formula for excel that retrieves financials data from the server by sending some parameters. The biggest challange is that worksheet could contains a thousands of such formulas and it needs to make thousands of web requests to a server. Idea is to collect formulas to a batch and make one request for a batch every N milliseconds. That means for each formula I need to wait until I get response for a whole batch.

Here I faced a ploblem: for every formula excel dna creates separate thread and it's wrong because I dont want to create thousands of threads. I'd liked to process formulas asynchronously so I need some kind of callback for each formula that I can use to put value back to cell after all batch will be processed. I didn't find a way how to do that with excel dna.

Can someone show me a workaround for that problem or point me to some examples how to do that?