Fix Office Scripts Not Refreshing Power BI Live Connections in Excel Online
Question details
Users are unable to refresh Power BI Semantic Model live connections using Office Scripts in Excel for the web, despite the script running without errors.

- Product
- Excel Online
- Device & OS
- not provided
- Scenario
- Attempting to automate the refresh of a Power BI live data connection via Office Scripts using workbook.refreshAllDataConnections().
- Observed behavior
- The Office Script executes successfully without throwing an error, but the Power BI data connection does not actually refresh. Manual refresh and Excel desktop refresh continue to function correctly.
Ensure that your Power BI Semantic Model live connection is properly configured, you are signed into the correct Microsoft account, and you have the necessary authentication permissions to access the underlying data source.
Use Manual Refresh All as a Workaround
Since the Office Scripts method is currently experiencing a limitation in Excel for the web, manually triggering the data refresh is the most reliable workaround.
The fact that a manual refresh successfully updates the data confirms that your workbook, the Power BI live connection, and your user authentication are entirely valid. The issue stems directly from how Excel for the web handles the script's Refresh All command.
Launch your web browser and open your targeted workbook in Excel for the web.
Click on the 'Data' tab located in the top ribbon menu.
Click on the 'Refresh All' button to manually force the Power BI live connection to update its semantic data.

Test the Script in a New Workbook
Isolating the issue in a fresh environment helps determine if the problem is specific to the current workbook's metadata or a broader Office Scripts limitation.
Report the Behavior to Microsoft
Because this issue is an unsupported behavior or a product regression in Excel for the web, reporting it directly to the product team is crucial for a future fix.
Try WPS Office for Your Spreadsheet and Data Needs
If you are encountering frustrating limitations with Excel Online and Office Scripts, consider switching to WPS Office. It provides a robust, highly compatible alternative for handling complex spreadsheets and data analysis without expensive subscription costs.

Frequently Asked Questions
Why does the Office Script complete without an error but fail to refresh the data?
In Excel for the web, Office Scripts may not fully support executing the automated Refresh All command for certain advanced external data sources, like Power BI live connections. This leads to a silent failure where the script engine registers a successful execution, but the underlying data connection refuses to update.
Does this data refresh issue affect the desktop version of Excel?
Generally, no. Users report that refreshing the same Power BI live connection using Excel desktop applications works as intended. The issue appears to be an Office Scripts limitation specific to Excel for the web.
Is there a way to automate Power BI refreshes if Office Scripts fail?
If workbook.refreshAllDataConnections() fails silently in Excel Online, you may need to rely on manual refreshes via the Data tab, or configure scheduled refreshes directly within the Power BI service using Power Automate instead of triggering them through an Excel-bound script.




