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

Microsoft 365 and Office SharePoint For business Windows
{count} votes

2 answers

Sort by: Most helpful
  1. Yanli Jiang - MSFT 31,596 Reputation points Microsoft External Staff
    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.


  2. Yanli Jiang - MSFT 31,596 Reputation points Microsoft External Staff
    2025-01-23T10:16:06.3266667+00:00

    Hi @Javier Gaig Mellado ,

    Sorry for the misunderstanding. It may be a problem with the Web API call. After all, as you said, it does work locally on Excel App. However, the forum resources are limited and we cannot view the backend API call status. Therefore, in order to solve the problem faster and better, we suggest you contact Microsoft directly.

    The support team over there has the correct escalation channel, they can involve more resource and investigate the behavior from back end as fast as possible. They also can check the behavior on your end remotely.  This is the most efficient way for handling this thread as per the situation.

    I hope this information helps. Please do let us know if you have any further queries.

    Kindly consider accepting the answer if the information provided is helpful. This can assist other community members in resolving similar issues.

    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.