0
votes

With the graph explorer & excel API I was able to get the used range of a worksheet with following endpoint:

https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets('Sheet1')/usedRange

However, the request returns a json full of formulas instead of the values calculated from those formulas that appear in the cell when opening the workbook in excel.

Is there a way to get Microsoft Graph to calculate my workbook instead of returning formulas when fetching ranges or cells?

1

1 Answers

2
votes

You could use values or text property of range object to get to computed values. text is what the users would see after applying number format (non trimmed version).

If your workbook is in manual mode and you like to calculate after updating the formula, you could run the calculate API against the workbook.

POST /me/drive/items/{id}/workbook/application/calculate

Body is optional. If you wish you could use below calculation options.

{
"calculationType" : "{calculationType}"
}

{calculationType} specifies the calculation type to use. Possible values are: Recalculate Default-option. Performs normal calculation by calculating all the formulas in the workbook,Full Forces a full calculation of the data, FullRebuild Forces a full calculation of the data and rebuilds the dependencies.