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
James, it's coming. But we are waiting for this functionality from year 2022. Nobody knows when it'll be.
4 Replies
- SergeiBaklanDiamond Contributor
James, it's coming. But we are waiting for this functionality from year 2022. Nobody knows when it'll be.
- Jamesp43510Copper Contributor
Thanks Sergei. I got excited when when Queries were able to run in the cloud. It seemed a natural reaction that the script would run also. Hey ho.
- NikolinoDEPlatinum 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.
- Jamesp43510Copper 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.