Why won't ChartSeries.getPoints() work in Excel for web?

Austin 0 Reputation points
2024-12-20T21:41:18.6666667+00:00

I have a workbook I've created in Excel for web with just a single column chart and some sample data to its side

User's image

Using office scripts, I'm trying to set the color of an individual column on the chart with this code:

function main(workbook: ExcelScript.Workbook) {

    const sheet = workbook.getWorksheet("Sheet1")
    const chart = sheet.getChart("Chart 1")
    const series = chart.getSeries()[0]

    const i = 3
    const point = series.getPoints()[i]
    point.getFormat().getFill().setSolidColor("red")
}

When I run this in Excel for web, I get the error ChartSeries getPoints: There was an internal error while processing the request.

But if I save this workbook locally and run this script on my desktop Excel, it works as expected. How can I make this code run in Excel for web?

Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
5,367 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,044 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.