Skip to main content
Solved

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

  • February 27, 2024
  • 11 replies
  • 681 views

Forum|alt.badge.img

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
Forum|alt.badge.img+17
  • 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.

 

Forum|alt.badge.img+12
  • Pathfinder Advocate | Tier 6
  • March 7, 2024

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

 


bamo
Forum|alt.badge.img+1
  • 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)


Forum|alt.badge.img

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


Forum|alt.badge.img

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
Forum|alt.badge.img+17
  • Most Valuable Pathfinder
  • Answer
  • February 19, 2025

Hi ​@rmandijaLDP-Italy ,

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

 

 


Marc Mueller
Most Valuable Pathfinder
Forum|alt.badge.img+17
  • Most Valuable Pathfinder
  • February 20, 2025

Hi ​@rmandijaLDP-Italy ,

something like this…
 

 

What do you think?

 

Cheers

Marc


Forum|alt.badge.img

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
Forum|alt.badge.img+14
  • Pathfinder Community Team
  • March 3, 2025

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


Forum|alt.badge.img

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.


Marc Mueller
Most Valuable Pathfinder
Forum|alt.badge.img+17
  • Most Valuable Pathfinder
  • March 3, 2025

Hi ​@rmandijaLDP-Italy,

have you tried it with the SharePoint package?

(don’t forget to use the SharePoint: Authenticate first)

 

Cheers

Marc