I’m using ICustomFunction and CalculateFormulas to resolve some custom formulas. The formulas that need to be calculated are much more efficient if they can be dealt with in a bulk manner. One easy way to do this is to run a calculate in a “collection mode” to scrape up all of the formulas, get the results in bulk, then run the calc again in “distribute mode” where you distribute results from a cache.
Here’s the issue though, some formulas may be referenced by other formulas, e.g. IF( CustomFunc(), dothis, tothat). In this situation you can’t bulk load the answer for CustomFunc and you need to provide a value immediately for the rest of the calculation chain to perform properly. That’s OK, but I would only want to perform the work for CustomFunc if in fact it’s being used by something else. If it’s just in a cell and not referenced by anything then I want to use my bulk processing algorithm.
So is there any way to determine that a cell or a formula or the calculation of a formula has dependencies. Similar to trace dependents in Microsoft Excel. Or alternatively is there any public access to the Calculation Chain?