Forum Discussion

Jamesp43510's avatar
Jamesp43510
Copper Contributor
Sep 05, 2025

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

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    James, it's coming. But we are waiting for this functionality from year 2022.  Nobody knows when it'll be. 

  • NikolinoDE's avatar
    NikolinoDE
    Gold 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.

Resources