Forum Discussion
Office Scripts does not refresh Power BI Query live connections in Excel Online
Hello everyone, I've got the following problem and am nearly going insane because it's causing so much problems 🥲
Summary
The Office Scripts method workbook.refreshAllDataConnections() no longer refreshes a live connection to a Power BI Semantic Model in Excel Online.
Environment
- Excel Online
- Office Scripts
- Power Automate ("Recurrence" + "Run Office Script")
- Live connection to a Power BI Semantic Model (Analyze in Excel)
Expected behavior
Calling
workbook.refreshAllDataConnections();
should trigger the same refresh as manually selecting Data → Refresh All in Excel Online.
Actual behavior
The script completes successfully without any error, but the workbook does not requery the Power BI Semantic Model.
Additional observations
- The same workbook worked correctly for approximately two years.
- The issue started around mid-July 2026.
- Manual Data → Refresh All in Excel Online refreshes successfully.
- Refreshing in Excel Desktop also works correctly.
- The problem occurs both:
- when running the Office Script manually from the Automate tab in Excel Online
- when running the same Office Script from Power Automate ("Run Office Script")
This suggests the issue is specific to the Office Scripts implementation of refreshAllDataConnections() rather than the workbook, authentication, or the Power BI connection itself.
Steps to reproduce
- Create an Excel workbook with a live connection to a Power BI Semantic Model.
- Confirm that manual Data → Refresh All refreshes the data successfully.
- Create an Office Script containing only:
function main(workbook: ExcelScript.Workbook) { // Refresh all data connections workbook.refreshAllDataConnections(); }
- Run the script.
Result
The script finishes successfully but no refresh is performed.
Expected result
The workbook should requery the Power BI Semantic Model exactly as when using the manual Refresh All button in Excel Online.
2 Replies
- SarahWilson1Tin Contributor
Hi, Siminio.
The comparison with the manual Refresh All action is important here. It shows that the workbook, the Power BI connection, and the signed-in user can refresh successfully. Since the same script also fails when run directly from Excel Online, this does not look like a Power Automate scheduling or authentication problem.
refreshAllDataConnections() does not reproduce every part of the manual Refresh All command in Excel for the web. A successful script run only means that the method returned without an error; it does not confirm that the Power BI live connection was actually refreshed.
A useful test is to create a new blank workbook, add the same Power BI semantic model connection, and run only the one-line script there. If it also fails, this provides a clear minimal example. Recalculation will not resolve the problem, because recalculating formulas does not force a Power BI connection to refresh.
For now, manual refresh is the reliable workaround. If an unattended process is essential, consider refreshing the Power BI semantic model on a schedule and then using Power Automate or a supported Power BI API to place the required data into an Excel table. This is different from an Analyze in Excel live connection, but it avoids relying on the Office Scripts refresh behavior. Refreshing the semantic model alone will not update the cached data in the workbook.
This should be raised with Microsoft as a potential regression or product limitation. Hopefully, the details above help identify the issue.
- kwargonautCopper Contributor
We're having the exact same behavior.