Share via

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

Keiran 0 Reputation points
9 Oct 2024, 10:21 pm

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?

Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,910 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,171 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jiajing Hua-MFST 14,655 Reputation points Microsoft Vendor
    10 Oct 2024, 6:56 am

    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.



  2. Anjuri, Pavan Sai Kumar 0 Reputation points
    13 Feb 2025, 7:31 am

    Have you found any solution for this issue?

    0 comments No comments

Your answer

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