(* As Excel JavaScript APIs evolve fast, I would like to re-ask a critical question. *)
How could we evaluate a formula in JavaScript API as Application.Evaluate does in VBA?
If there is no dedicated API, what are the workarounds today?
PS: previous workarounds were, for instance,
- by using named ranges as described here, where we need to create a named range for the formula. We may also need to adjust the formula (e.g., convert range references to absolute references with the name of the active worksheet). Additionally, although adding named ranges on Excel Online by JavaScript API is permitted, loading their value by JavaScript API returns
#BLOCKED!
. - write the formula to a cell in the workbook, let Excel evaluate that, and read the value. The disadvantage is that borrowing a cell from the workbook is not neat.
- worksheet functions as described here. But I guess worksheet functions don't work with dynamic arrays yet?