Excel SCRIPT not running in P.automate

Nestor Herrera 0 Reputation points
2024-07-12T20:44:26.7333333+00:00

A P.automate flow uses an Excel script to create a chart but the line where Getpoints is used causes an error in online execution. Desktop script execution works w-o issues.

variable03[0].getPoints()[0].getFormat().getBorder().setColor("#B50A0A");
"message": "We were unable to run the script. Please try again.\nOffice JS error: Line 599: {\"message\":\"There was an internal error while processing the request.\",\"code\":\"GeneralException\",\"type\":\"ChartSeries\",\"method\":\"getPoints\",\"line\":599}\r\nclientRequestId: c1e3da13-d651-4130-9993-a04d6f2a39ae",
  "logs": []
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,954 questions
JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
995 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Claudia Dos Santos Haz (CONCENTRIX CORPORATION) 1,105 Reputation points Microsoft Vendor
    2024-07-15T12:08:11.1566667+00:00

    Hi @Nestor Herrera

    Thank you for reaching out to Microsoft Q&A forum!

    It seems like you’re encountering a runtime error with the GetPoints method in your Excel script when running it online through Power Automate. This type of error typically occurs due to logic issues in the script, such as an object not being present in the workbook or a discrepancy between the script’s requirements and the current workbook1.

    Here are a few steps you can take to troubleshoot and resolve the issue:

    1. Check the Workbook and Worksheet Names: Ensure that the workbook and worksheet names referenced in your script match exactly with those in the Excel file you’ve selected in Power Automate.
    2. Review Platform Limits: There might be limitations on the Office Scripts platform due to Excel or Power Automate. For example, trying to write too much data at once with Excel on the web can cause errors1.
    3. Examine the Script: Look for any logic issues that might be causing the GetPoints method to fail. The error could be due to the chart series not being present or incorrectly referenced.
    4. Test in Excel Online: If possible, run the script manually in Excel Online to see if the issue persists. This can help determine if the problem is specific to Power Automate.

    If you’ve already tried these steps and the issue remains unresolved, it might be related to a temporary service outage or a backend issue with Power Automate. In such cases, waiting for a while or contacting support for assistance would be advisable2.

    0 comments No comments

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.