Currently, it is not possible to pass a formula to the Office API and receive an evaluation of it. There are workarounds, like writing to an empty cell, or writing to a scoped name. Both solutions a...
ry_mac_202
Apr 23, 2024Copper Contributor
Yes, we absolutely need a way to evaluate formulas programmatically. Entering formulas into blank cells to read their values is a hack, and one that violates multiple best practices for Excel development. For example, when changing contents of a cells, you want to suspend screenUpdating. But to read the value in a cell you have to call context.sync(), which turns screenUpdating back on. So, when you need to evaluate multiple formulas, there is effectively no way suspend screenUpdating. Also, changing cell contents can trigger application events and calculations that the developer needs to be cognizant of. And, the blank cell hack probably has a performance hit in some scenarios.