Forum Discussion
Can I refresh Power Query with Office script?
Hi Anonymous
You may have a look at this thread powerquery - Refresh All Queries and Connections of an Excel Workbook (Excel Online) using Office Scripts and Power Automate - Stack Overflow. It seems that the behavior doesn't change yet. It doesn't support to refresh queries whose data sources are outside of the Excel file.
You may consider the solution in message 5 from thread: Auto Refresh an Excel File that has Power Query So... - Power Platform Community (microsoft.com). You can select the Refresh data when opening the file check box from the Connection Properties dialog box >> Usage tab >> Refresh control. Create a flow to open the Excel file and refresh all queries, then close the file. However this requires Power Automate Desktop if all of your Excel files are in the on-premises drive.
This seems not possible with Power Automate Cloud currently.
Power Query Refresh is now generally available in Excel for the web (microsoft.com)
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.