Skip to content

Ability to Change Column Header Text in Pivot Table #751

@ctphillips

Description

@ctphillips

Describe your scenario

What is the problem to solve?

After creating a pivot table using office scripts, currently there does not appear to be a way to change the name of the column headers. You can get the pivotTable.getLayout().getColumnLabelRange().getValues() but when you call pivotTable.getLayout().getColumnLabelRange().setValues(someNewValues[][]) you get the error: Range setValues: The operation failed because it conflicts with a pivot table range. So it seems like you cannot use the setValues method on the column header range within a pivot table, but there does not seem to be a method provided to perform this task. I also attempt to record the action of changing the column headers manually, but the recording just states that the action is not recordable (or some similar message in the recorded script output).

Which APIs or Excel features?

What should be showcased in the sample? Are there Excel features that need samples to better understand how to use them in scripts?

The pivot layout interface should provide a method for setting the column labels, or allow the range setValues() method access to write just the header values.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions