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

Community site session details

Session Id : Ijp+UyKXRnBNxBsDuuQyYk
Power Automate - Building Flows
Suggested answer

Power Automate: "Delete File" Fails Due to Locked File Error

Like (1) ShareShare
ReportReport
Posted on 18 Mar 2025 03:03:10 by 5

Hello,

 

I'm facing an issue in Power Automate when trying to delete a file. After using the "Delete file" action, I get an error stating that the file is locked.

Here's the process:


  1. I retrieve a file from SharePoint, which is used as a template.

  2. The file is moved to OneDrive.

  3. An Excel script runs on the file in OneDrive.

  4. The file is then moved back to a SharePoint folder.

  5. I try to delete the temporary file from OneDrive, but I get a file locked error.


  6.  

A workaround would be to keep the template in OneDrive, but the users prefer not to have it stored there.

 
I have the same question (0)
  • AN-04030826-0 Profile Picture
    5 on 25 Apr 2025 at 04:00:14
    Power Automate: "Delete File" Fails Due to Locked File Error
    Hi @Michael E. Gernaey,
     

    Sorry for the late reply. I’ve already tried, even waiting up to 10 minutes and also using a loop to wait for an hour — but it still didn’t work.

     

  • Suggested answer
    Michael E. Gernaey Profile Picture
    48,288 Super User 2025 Season 2 on 05 Apr 2025 at 07:28:22
    Power Automate: "Delete File" Fails Due to Locked File Error
     
    Before you delete, add a Wait action. Since its excel this happens a lot in many scenarios.
     
    Add it to be 3-10 minutes (ugg yeah 10 minutes) and it should go away.
     
    Wasn't sure if you already resolved this or not.
     
    If this helps you, if you do not mind Marking it as such and maybe a like. :-)
     
    If you have further questions, please let me know.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 783 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 515 Moderator

#3
trice602 Profile Picture

trice602 299 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading complete