Share via

Excel Scripts "Refresh All" function not working for Excel Online

Keiran 0 Reputation points
2024-10-09T22:21:39.6866667+00:00

I have recorded a very basic Office script, as below: function main(workbook: ExcelScript.Workbook) {

  // Refresh all data connections

  workbook.refreshAllDataConnections();

}

It refuses to refresh the Power Query data that is coming from 2 tables within the same workbook.

It works perfectly on the desktop version of Excel, but not on the Online version. When i manually select "Refresh All" on Excel Online, it works perfectly fine. What gives? I thought the whole point of Office scripts was to allow it to work online?

Anyone have any guidance?

Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft 365 and Office | Excel | For business | Windows

3 answers

Sort by: Most helpful
  1. Jiajing Hua 18,175 Reputation points Moderator
    2024-10-10T06:56:53.6+00:00

    Hi @KeiranDo you refresh this workbook with the Office Script to update the Queries and reuse the Query in Power Automate?

    Please note, refresh not fully supported in Power Automate. Office Scripts can't refresh most data when run in Power Automate, Workbook.refreshAllDataConnections only refreshes when PowerBI is the source.

    For more, please refer to this link: https://learn.microsoft.com/en-us/office/dev/scripts/testing/power-automate-troubleshooting#refresh-not-fully-supported-in-power-automate


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    1 person found this answer helpful.

  2. Fernando Gois 30 Reputation points
    2026-03-29T21:00:14.62+00:00

    Is the "Refresh All" still not working when against a Power Query?

    0 comments No comments

  3. Anjuri, Pavan Sai Kumar 0 Reputation points
    2025-02-13T07:31:07.5866667+00:00

    Have you found any solution for this issue?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.