Edit the "Row Labels" field of a PivotTable using ExcelScript

58 views Asked by At

I am attempting to modify the Row Labels field of a Pivot Table using ExcelScript, but cannot modify the cell. When I attempt to modify it, I get the following error:

"The operation failed because it conflicts with a pivot table range".

I've tried the following methods/code:

  1. PIVOTTABLE.getLayout.getRange().getCell(0,0).setValue("VALUE");
  2. selectedSheet.getRange("CELL").setValue("VALUE");
    (The second method was generated using the step recorder, but it doesn't work when I try to run it).

I have no issue editing it manually. Is this something that can't be done using ExcelScript?

For reference, I'm trying to edit the cell in the top-left corner of PivotTable, as shown below:

enter image description here

0

There are 0 answers