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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Excel Run Script Sudde...
Power Automate
Suggested Answer

Excel Run Script Suddenly stops working

(1) ShareShare
ReportReport
Posted on by 173
Hi - 
 
Our flow has been running smoothly since October last year, one of the key features of the flow is that it Runs a script against a workbook stored in SharePoint document library's subfolder. Since this month, we are not getting an error "Forbidden. Make sure you have appropriate permissions to edit the workbook.
 
I checked manually to see if I have still have full control on the workbook and indeed permissions are as is and i have full control. Does anyone have any suggestions as to why this error is occuring? 
 
 
Categories:
I have the same question (0)
  • Suggested answer
    rzaneti Profile Picture
    4,491 Super User 2026 Season 1 on at
     
    Are you experiencing this issue with this flow in particular, or in other flows too? If you have no other flows running scripts, please create a new one just for testing purposes, perhaps referencing the exact same file that should be accessed by the flow run where you got the error, so you can confirm if this is something particular to this file.
     
    A few other ideas to address this issue:
    - Confirm you're using your own connection to the action, or the connection of a user that has access to the file
    - Refresh the connection used for this action (this may be the root cause, since the flow was working fine so far)
    - Confirm if you have any logic out executed before the unprotect code in your main function (it's probably not the cause, since the error message would be different)
    - Remove the action and add it again
     
    By the way, I recently started a website to share Office Script templates created by the community: https://www.officescriptsgallery.com/. If you have any interesting scripts that you would like to share, please get in touch :)
     
     
    Let me know if it works for you or if you need any additional help!
     
    If this solved your issue, please mark it as Accepted Answer.
    👍 If it helped, feel free to give it a like!

    🌐 Explore more Power Platform content on my Website or on my ▶️ YouTube
    💼 Find me on LinkedIn
  • ctrl_kudorje Profile Picture
    173 on at
    Hi@rzaneti - Yes I have refreshed and even created a new excel file in a different environment, but yet we have the same issue. Just curious, are you having the same issue on your end? Does the action Run Script work okay for you?
     
    Thank you!
  • Suggested answer
    Haque Profile Picture
    2,883 on at
    Hi @@ctrl_kudorje,
     
     
    Let's summarise what is done so far:
     
    1. Premission and credentials look fine - as you have checked.
    2. You have tried with a fresh workbook in another environment that fails!
    3. You have refrehsed the connection, I considered you have removed the existing connection and reconnected and  also cleaned browse cashe (clean refresh)
     
    To me, it seems it a platform‑level change in Excel Online scripts and Power Automate connectors rather than your specific file or environment.
     
    Based on the above statment, I wouls suggest the following troublshootings to narrow down the issues.
     
    • Confirm library type - Please open the workbook in Excel Online --> check if the Automate tab (Office Scripts) is available. If it’s missing, the library doesn’t support scripts anymore.

    • Test in OneDrive - You can do the same test bit differently. Please copy the workbook to your OneDrive. Update the flow to point to that location.If the script runs there, the issue is library compatibility.

    • Check connector version - In Power Automate → Data → Connections → Excel Online (Business). Re‑create the connection to ensure it uses the latest connector version.

    • Ask your admin about policy changes - Please verify if new Conditional Access or DLP rules were applied this month. These can silently block flows from editing files even if you have full control.

    • Service account test - Try running the flow with a dedicated service account connection. If that works, the issue is user credential enforcement.

    Plese let me know if these check-n-balance triggers the luck.

     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
  • rzaneti Profile Picture
    4,491 Super User 2026 Season 1 on at
     
    I have a few flows with Run scripts action running in a daily basis in different tenants and I didn't notice any issues lately - the action is working fine from my side.
     
    There are no issues reported in Service Health (at least for now), so this might be something particular to your tenant. Are the other Excel actions (List rows present in a table, get row) working fine? Also, try to edit the flow in an incognito window, save it, and run it again. 
     
    If nothing works, please share your script and the rest of your flow design, removing any sensitive data. 
     
    Let me know if it works for you or if you need any additional help!
     
    If this solved your issue, please mark it as Accepted Answer.
    👍 If it helped, feel free to give it a like!

    🌐 Explore more Power Platform content on my Website or on my ▶️ YouTube
    💼 Find me on LinkedIn
  • ctrl_kudorje Profile Picture
    173 on at
    @rzaneti @Haque: I have done these recommended steps. I think this is admin level driven. Do you know where in admin settings this would be influenced from? By the way I dont see a hard block on the excel business connector for Data loss policies (DLP). There is most likely a setting some where that influences this. 
     
    Any ideas?
  • Suggested answer
    Haque Profile Picture
    2,883 on at
    Hi @ctrl_kudorje
     
    Can you please check the following refeences:
     
    1. Data loss prevention (DLP) policies
    2. Data Policy
    3. DLP Violation
     
    Can you please see if any DLP realtes seettings are there here? I see some settings have been changed since last managed. I am still investigating.
     
    Or just type DLP at the search bar of your Power Platform Admin Centre and then make sure where policy has been applied.
     
     
    PPA--> Security-->Data and privacy | you can check here what policy has been created and assigned to.
     
    500
     
     
     
  • ctrl_kudorje Profile Picture
    173 on at
    I see, so you know if there is any setting for Office Scripts? Funny enough the other excel business connectors work like get row etc. it’s just the office script run scrip my or run script from share point library that is not working. 
     
    do you know any setting that would influence it?
  • ctrl_kudorje Profile Picture
    173 on at
    Just to confirm we don’t have access to control admin access. 
  • Suggested answer
    Haque Profile Picture
    2,883 on at
    Hi @ctrl_kudorje,
     
    Just going back to one previous questoin - did you test from the OneDrive - the same error message it showed?
     
    Bittering though - can you please have a copy of your flow and create a brand new one following the same steps and see what happens?
     
    Please see this video from 5 mints section
     
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard