Hi,
I got an issue with using the getSeries() function in excel script.
I want to write script to change the color of the pie chart. I did it manually and I recorded it.
The below is the code:
function main(workbook: ExcelScript.Workbook) {
let selectedSheet = workbook.getActiveWorksheet();
let TestingChart = selectedSheet.getChart("TestingChart");
// Set fill color on series for a chart
TestingChart.getSeries()[0].getFormat().getFill().setSolidColor("#FF0000");
}
However, when I try to run it again. I got error "Chart getSeries: The requested resource doesn't exist."
the chart is a pie chart and I am pretty sure the chart contains some series on it.
Thank you.