OfficeDev / OfficeDev/office-scripts-docs

Office script to refresh all data connections of the workbook not working in PowerAutomate

Open
#785 14 comments 0 reactions 2 assignees View on GitHub

@wandyezj is already working on this.

Since Jun 16, 2025.

Status: under investigation Type: product bug
Dominant language
No language data
Stars
235
Forks
68
Avg merge
6d 7h
Merged PRs (30d)
2

Description

Hi experts,
I have used the Office script to refresh all data connections of the workbook. The workbook uses the OLEDB connection to the Power BI dataset.

function main(workbook: ExcelScript.Workbook) {
workbook.refreshAllDataConnections();
}

But while running this script via Power Automate, I get the following error.

**Error
Action 'Run_script' failed

We were unable to run the script. Please try again.
Office JS error: Line 2: Workbook refreshAllDataConnections: There was an internal error while processing the request.
clientRequestId: f8c5616e-ecb9-4670-9eaf-a7764e754453**

some hints please...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.