web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Running office script ...
Power Automate
Unanswered

Running office script with Workbook.refreshAllDataConnections() has suddenly returned an error

(5) ShareShare
ReportReport
Posted on by 48

Hi,

 

I use Power automate to refresh an excel table that is connected to Power BI every day.

This is via a 'Run Script' prompt that refers to a script containing Workbook.refreshAllDataConnections().

 

This has always functioned very well. However, as of today, I receive the below error.

Has Microsoft changed the possibility to use Workbook.refreshAllDataConnections() or might there be something else?

 

The error message:

"We were unable to run the script. Please try again.
Runtime error: Line 5: Workbook.refreshAllDataConnections() is not supported in Power Automate.
clientRequestId: 566bd94c-36fd-4090-aa5c-cc47459f3b53"

Categories:
I have the same question (0)
  • BTAPA Profile Picture
    20 on at

    I'm getting the same error. Flow worked fine up until today.

  • joachimmoens Profile Picture
    48 on at

    I have just found another thread (that was also created yesterday) that refers to the same issue and has a proposed solution.

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

  • RPeralta160 Profile Picture
    2 on at

    Hello,

     

    Did you find any solution to this problem?
    I'm getting the same issue, and i can't find the "Refresh Workbook" in Power Automate

  • joachimmoens Profile Picture
    48 on at

    The solutions proposed in the other thread do not work for me either. I think the command is debunk, but I do not know if Power is planning to fix the issue.

  • Verified answer
    Yutao Huang Profile Picture
    Microsoft Employee on at

    Apologize! This was indeed a regression on our side, and it should be fixed now. Please let us know if you are still having issues with refreshing Power BI data connections.

     

    Thanks for your patience and support!

     

    P.S.: Just to be clear, currently only the Power BI data connections can be refreshed through the workbook.refreshAllDataConnections() API. We have been working to support refreshing the other data connection types, but currently we don't have a concrete timeline to share yet. Thanks again for your patience and support!

  • joachimmoens Profile Picture
    48 on at

    It seems that this has been resolved for a while, but a bug has come back for refreshing a PowerBI connection with workbook.refreshAllDataConnections

     

    Workbook refreshAllDataConnections: There was an internal error while processing the request.

  • joachimmoens Profile Picture
    48 on at

    AS OF MONDAY 15TH MAY I HAVE NO ERROR MESSAGE ANYMORE. HOWEVER THE REFRESH SIMPLY DOESN'T PERFORM A REFRESH. THE SCRIPT DOES WORK FINE WHEN IT IS NOT CALLED FROM POWER AUTOMATE.

     

    New issue created: https://powerusers.microsoft.com/t5/Using-Connectors/Running-office-script-with-Workbook-refreshAllDataConnections/td-p/2153099

  • RodolpheF Profile Picture
    6 on at

    Hi Yutao,
    It's been almost a year! Where have we been with this issue? Refreshalldataconnections is key in script with Power Automate... How Microsoft can miss that! We need it please! 
    When you say "only Power BI connections", will you exclude Power Query in Excel? Both are in DAX languages and almost the same queries though... 

  • RodolpheF Profile Picture
    6 on at

    Please this topic is everything but not solved! This is missleading and unfair for those who need this particular but essential feature! 

  • MF-05091302-0 Profile Picture
    7 on at
    Has this issue come back again? I have a flow that has been running fine for over a year, then 2 days ago I started receiving this same error message.
    I have isolated it to only run a simple refresh in my script to be sure:
     
    workbook.refreshAllDataConnections();
     
     
    And this is what I get: "Action 'Run_script' failed: We were unable to run the script. Please try again. Office JS error: Line 3: Workbook refreshAllDataConnections"

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard