
4,391 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have an excel script which used to run with no problems. Suddenly I'am getting an error when trying to set a column to summarise by average in a pivot table. I get the following error:
DataPivotHierarchy setSummarizeBy: The argument is invalid or missing or has an incorrect format.
when running the following snippet:
netAppPivotTable.addDataHierarchy(netAppPivotTable.getHierarchy("Count of Usable Capacity (PB)"));
let field = netAppPivotTable.getDataHierarchy("Count of Usable Capacity (PB)");
field.setPosition(0);
console.log(field);
field.setSummarizeBy(ExcelScript.AggregationFunction.sum);
Even though I' am calling with a valid DataPivotHierarchy object:
{
"type": "DataPivotHierarchy",
"instance": {
"m_contextBase": {
"m_nextId": 397,
"m_customRequestHeaders": {},
"m_batchMode": 0,
"_onRunFinishedNotifiers": [],
"m_requestUrlAndHeaderInfoResolver": {
"_resolveRequestUrlAndHeaderInfo": "function () {\r\n return OfficeExtension.Utility._createPromiseFromResult(null);\r\n }",
"_createRequestExecutorOrNull": "function () {\r\n if (!WorkerRequestExecutor.globalWorkerRequestExecutor) {\r\n WorkerRequestExecutor.globalWorkerRequestExecutor =\r\n new WorkerRequestExecutor();\r\n }\r\n return WorkerRequestExecutor.globalWorkerRequestExecutor;\r\n }"
},
"_processingResult": false,
"_customData": "IterativeExecutor",
"sync": "function () { [native code] }",
"m_workbook": {
"m_contextBase": "<CIRCULAR REFERENCE OBJECT>",
"m_objectPath": {
"m_objectPathInfo": {
"Id": 1,
"ObjectPathType": 1,
"Name": ""
},
"m_parentObjectPath": null,
"m_isCollection": false,
"m_isInvalidAfterRequest": false,
"m_isValid": true,
"m_operationType": 1,
"m_flags": 4
},
"m_context": "<CIRCULAR REFERENCE OBJECT>",
"m_worksheets": {
"m_contextBase": "<CIRCULAR REFERENCE OBJECT>",
"m_objectPath": {
"m_objectPathInfo": {
"Id": 4,
"ObjectPathType": 4,
"Name": "Worksheets",
"ParentObjectPathId": 1
},
"m_parentObjectPath": {
"m_objectPathInfo": {
"Id": 1,
"ObjectPathType": 1,
"Name": ""
},
"m_parentObjectPath": null,
"m_isCollection": false,
"m_isInvalidAfterRequest": false,
"m_isValid": true,
"m_operationType": 1,
"m_flags": 4
},
"m_isCollection": true,
"m_isInvalidAfterRequest": false,
"m_isValid": true,
"m_operationType": 1,
"m_flags": 4
},
"m_context": "<CIRCULAR REFERENCE OBJECT>",
"m_isNull": false
},
Can anyone please provide some guidance?