The excel javascript API can request data from an external service as outlined here: https://learn.microsoft.com/en-us/office/dev/add-ins/excel/custom-functions-web-reqs
However, imagine a UDF that must retrieve contiguous parts of a database or API. Each cell would need to call out to the server repeatedly and a lot of unnecessary requests and latency pile up.
Is it possible to batch up these requests, i.e.
-
- detect the start/end of the range
-
- fetch the data in a single request
-
- update the range in Excel asynchronously (to not block the UI)