Power Query Problems

Fix Power Query Refresh Failing in Excel Office Scripts

Emma BrownEmma Brown Nov 10, 2026 868 views

Question details

The user needs to understand why calling refreshAllDataConnections() from an Office Script in Power Automate fails to refresh Power Query results, and how to resolve or work around this limitation.

How to Fix Power Query Refresh Issues in Excel Office Scripts and Power Automate
Product
Microsoft Excel, Power Automate
Device & OS
not provided
Scenario
Attempting to automate the refresh of Power Query data connections using an Office Script triggered by a Power Automate flow.
Observed behavior
The workbook.refreshAllDataConnections() method does not successfully refresh the Power Query results due to compatibility and authentication limitations in Excel for the web.
Before you start

Verify the type of data connection used in your Power Query setup and ensure you have access to native Power Automate connectors, as Excel for the web currently limits authenticated data source refreshes via scripts.

Solution 1Recommended

Use Native Power Automate Connectors Instead of Office Scripts

Bypass the Office Script limitation by using native Power Automate connectors to fetch and update your data securely.

Excel for the web, which Power Automate uses to execute Office Scripts, does not support the workbook.refreshAllDataConnections() method for most authenticated data sources. Trying to force a refresh this way will cause the flow to fail or silently skip the update.

The most reliable workaround is to shift the data retrieval workload from Excel's Power Query directly to Power Automate's native connectors.

1
Identify your data source

Determine where your Power Query data originates (e.g., SQL Server, SharePoint List, Dataverse).

2
Add a native connector action

Open your Power Automate flow editor and click 'Add an action'. Search for and select the native connector that corresponds to your database or data source to retrieve the data.

3
Insert data into Excel directly

Use the 'Excel Online (Business) - Add a row into a table' action within an 'Apply to each' loop to insert the retrieved data directly into your target workbook, bypassing the need for a Power Query refresh entirely.

Use Native Power Automate Connectors Instead of Office Scripts
Connector Advantages: Using direct Power Automate connectors eliminates authentication blocks and makes your automated flow significantly more stable.
Free Microsoft Office alternative

Switch to WPS Office for a Seamless Spreadsheet Experience

Dealing with complex script limitations and unsupported features in Microsoft Excel for the web can disrupt your workflow. WPS Office provides a free, lightweight, and highly compatible alternative for your daily spreadsheet and data analysis needs. Enjoy a familiar interface and excellent compatibility without the heavy technical overhead.

  1. 1. Download the software: Visit the official WPS website and click 'Download WPS Office Free'.
  2. 2. Install and launch: Follow the installation prompts and open the WPS Spreadsheet application.
  3. 3. Open existing files: Open your standard .xlsx workbooks directly; all your existing formatting and basic data remain perfectly intact.
  4. 4. Manage your data: Utilize the intuitive ribbon interface to analyze, filter, and process your daily data tasks effortlessly.
Highly compatible with Microsoft Excel formats (.xlsx, .xls, .csv)Free and lightweight suite perfect for everyday data analysis and formattingFamiliar user interface allows for seamless migration with zero learning curvePowerful built-in formulas and robust data processing tools
microsoft office alternative - wps office

Frequently Asked Questions

Why does workbook.refreshAllDataConnections() work on Excel Desktop but not in Power Automate?

Power Automate relies on Excel for the web to execute Office Scripts. Excel for the web currently has strict limitations regarding authenticated Power Query external data sources and does not support full connection refreshes through scripting like the desktop version does.

Can I automatically refresh Power Query in Excel for the web at all?

Automatic refresh in Excel for the web is heavily restricted. It typically only works for anonymous, publicly accessible data sources or specific organizational setups natively supported without complex authentication prompts.

Are there other tools to automate Microsoft data refreshes effectively?

Yes. If Power Automate and Excel for the web cannot refresh your specific dataset, consider using Power BI to handle complex data modeling and scheduled refreshes, as it is designed specifically for robust automated data pipelines.