Forum Discussion
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 available yet?
Many thanks
James
2 Replies
- SergeiBaklanDiamond Contributor
James, it's coming. But we are waiting for this functionality from year 2022. Nobody knows when it'll be.
- NikolinoDEGold 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.