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 / facing error while del...
Power Automate
Unanswered

facing error while deleting file using Delete file activity in power automation desktop

(0) ShareShare
ReportReport
Posted on by 159

facing error while deleting file using Delete file activity.

 

neerajpokh_0-1662041574397.png

 

it throws error that 

Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Can't delete file C:\Recon\Data\Input\09_2022\a.xlsx --->
System.IO.IOException: The process cannot access the file 'C:\Recon\Data\Input\09_2022\a.xlsx'
because it is being used by another process.

also file is already available to delete

neerajpokh_1-1662041793788.png

 

can you please help on this

I have the same question (0)
  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    This issue comes when a file instance is running in Processes. So first terminate the instance then try to delete it.

    Kaif_Siddique_0-1662053942873.png

     

    If you like my response, please give it a Thumbs Up.
    If this helps, please Accept as solution.

     

    Regards
    Kaif

  • ryule Profile Picture
    929 Super User 2024 Season 1 on at

    If you are okay with closing ALL excel instances, yes, Kaif's should work. Otherwise, just make sure you close the Excel Instance that is running that a.xlsx file.

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Yes @ryule .. this will close all the excel files.. thanks for highlighting.

  • neerajpokh Profile Picture
    159 on at

    after terminating 

    neerajpokh_0-1662102113143.png

     

    still not working and getting same issue

     

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Selected terminate process name is EXCEL.EXE. Please select terminate process name Excel only

    Kaif_Siddique_1-1662131462787.png

     

    If you like my response, please give it a Thumbs Up.
    If this helps, please Accept as solution.

     

    Regards
    Kaif

  • Pavel_NaNoi Profile Picture
    1,074 on at

    Argh, this horrible issue again, this is because the previous action that was working on the file is "stuck" to it, more here: https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Rename-file-in-loop-after-OCR/m-p/1660516#M15876

     

    In your case maybe (as I don't know the full extent of your automation I can only see a snippet of what's going on) just put a "get files from folder" action before the delete file action that just re-acquires it, might work.

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard