Excel Script "Refresh All" not working on Excel Online (Sharepoint)

Javier Gaig Mellado 0 Reputation points
2025-01-21T12:57:22.79+00:00

I have to refresh several excel files in an automated way, so I have created an Azure Logic App workflow that, using an Excel Online (Bussiness) connector, lets me execute a Script from Sharepoint.

The script is really simple, it just makes a "Refresh All":

function main(workbook: ExcelScript.Workbook) {
	// Refresh all data connections
	workbook.refreshAllDataConnections();
}

This script is working perfectly when Excel file is opened locally, but when executed manually form Excel online (from Sharepoint) it does not update the workbook.

Note: all Excel data source are Power BI

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,091 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yanli Jiang - MSFT 28,526 Reputation points Microsoft Vendor
    2025-01-22T10:10:43.79+00:00

    Hi @Javier Gaig Mellado ,

    Welcome to Q&A forum!

    According to your description, the cause of the problem cannot be determined. As a SharePoint engineer, my knowledge of Azure Logic apps is limited. Without the ability to test, I did a lot of searching. Although there is not much information about this issue, I found that this problem also occurs in Power Automate. Power Automate is also a Microsoft product about automation. Here are some posts for your reference, I hope they can help you:

    https://learn.microsoft.com/en-us/answers/questions/1250098/workbook-refreshalldataconnections()-is-not-suppor?page=3#answers

    https://learn.microsoft.com/en-us/answers/questions/2100696/excel-scripts-refresh-all-function-not-working-for

    Good day!


    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.


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.