Forum Discussion
Jamesp43510
Sep 05, 2025Copper Contributor
Excel script not updating the Refresh All button
I've used ChatGPT to create an Excel Script to effectively click on the Refresh All button to update a Query. However nothing seems to happen. Can someone confirm if this functionality not availab...
NikolinoDE
Sep 06, 2025Gold Contributor
Office Scripts cannot trigger the “Refresh All” button or directly refresh Power Query connections...so far i know. Scripts only expose functionality for tables, ranges, charts, formatting, etc., but refreshing queries and external connections is not yet supported in the API.
That’s why “nothing happens” in your script, the method you tried to use doesn’t exist in the runtime.
In desktop Excel, you can use VBA:
Sub RefreshAllQueries()
ThisWorkbook.RefreshAll
End Sub
My answers are voluntary and without guarantee!
Hope this will help you.
- Jamesp43510Sep 08, 2025Copper Contributor
Thanks Nilolino, I'm already using this. Just wanted to move into the 21st century with Script and Power Automate to do this hands free.