Skip to main content
Ground Control | Tier 1
February 27, 2024
Solved

Unable to delete the file(s) because they are being used by another process

  • February 27, 2024
  • 11 replies
  • 913 views

I am trying to delete a pdf file after it has been downloaded and bot sometimes will delete sometimes will not. PDF is not being opened or modified at this step. I have tried high delays but AA will not release pdf. 

Best answer by Marc Mueller

Hi ​@rmandijaLDP-Italy ,

will this somehow work before file delete? (implemented in a proper Error handling)

 

 

11 replies

Zaid Chougle
Navigator | Tier 3
Navigator | Tier 3
February 28, 2024

I am trying to delete a pdf file after it has been downloaded and bot sometimes will delete sometimes will not. PDF is not being opened or modified at this step. I have tried high delays but AA will not release pdf. 

It should not happen, request you to please try it manually once and also see it in task manager whether it is being used by another process or not.

 
Lets Automate !
Pathfinder Advocate | Tier 6
March 7, 2024

be sure you use close:excel action before  before you delete. 

 

bamo
Cadet | Tier 2
March 8, 2024

Hi,

I would suggest you to implement robust error handling in your automation script to capture any errors that might occur during the deletion process.

And I hope this will help you diagnose the issue more effectively if you didn’t try in past.

 

Thanks

Bamo

Professional (AWS Big Data)

Cadet | Tier 2
July 23, 2024

Hi , I am also facing the same issue that Unable to delete the file(s) because they are being used by another process.
 

I am trying to delete the Input file after extracting and downloading the file using document extraction package, tried with delay command and closing the application also

Cadet | Tier 2
February 19, 2025

Hi all, I have the same problem. I am using PdfUtils to extract some data into a string and after finishing I have to delete the file. The idea is that if I leave +1 minute delay it works sometimes, but when I try normally, like 10 seconds, it never works and when I delete it manually during the process it works only the delete file action is giving me that error and I don't understand why if somebody found a solution to that.

Marc Mueller
Most Valuable Pathfinder
Most Valuable Pathfinder
February 19, 2025

Hi ​@rmandijaLDP-Italy ,

will this somehow work before file delete? (implemented in a proper Error handling)

 

 

🤝Let's connect on LinkedIn: https://www.linkedin.com/in/developer-marc-mueller >>>>>>>> 📺Check out my YouTube channel - https://youtube.com/@AutomationDevelopmentEasy
Marc Mueller
Most Valuable Pathfinder
Most Valuable Pathfinder
February 20, 2025

Hi ​@rmandijaLDP-Italy ,

something like this…
 

 

What do you think?

 

Cheers

Marc

🤝Let's connect on LinkedIn: https://www.linkedin.com/in/developer-marc-mueller >>>>>>>> 📺Check out my YouTube channel - https://youtube.com/@AutomationDevelopmentEasy
Cadet | Tier 2
February 20, 2025

Hi Marc 1985,
Will try the taskkill if it works will write back here.
Just send you a conncet in linkedin.
Thank you in advance for the idea.

Shreya.Kumar
Pathfinder Community Team
March 3, 2025

@rmandijaLDP-Italy were you able to resolve the error?

Cadet | Tier 2
March 3, 2025

Hi @Shreya.Kumar even after the method suggested by @Marc 1985 we are still having the problem, I also tried to perform the data extraction and deletion in two separate taskbots but still without success if I do it manually they are deleted but with the bot the error persists. I also tried locally since the files I was working on were on sharepoint but always the same result if you set a 30 second delay or more 2 times out of 5 the file is deleted, for the moment I'm still doing some tests.