The cause is because the file inside which is png is used to be resized (I’m using Balareva Resize Image activity and also tried another approach using Invoke Method).
There’s someone with similiar problem, I tried their solution but no go.
The error is because image is opened in background, can you try to use Kill Process activity before Delete Folder activity
In Kill Process activity mention Microsoft.Photos
Are you using the png files in the further below workflow process. Since the error indiactes that 19-Januari-2024.png picture is being used and is opened in the backgroung. That’s the reason it’s not deleting the folder. Try the close that png process and try giving Delete Folder. This should work for you.
the file is not actually opened. It is used by resize Image activity before attempt to delete the folder that contains the file. The one and only process that affect the file is UiPath.executor itself and of course I can’t kill it
Instead of Resize Image activity could you download the xaml file of Resizing images in the below thread and after that Delete Folder. I have attached the thread too.
Ahh sorry nevermind. I found the cause myself.
it is because the Variable bitmap that I made for the purpose of resizing the image. Since The Bitmap Var is assigned like this:
bitmapImage = New Bitmap(“Path of the Image”)
so the file itself is bound to the variable hence I need to dispose the value of the var using Invoke Method Dispose first then proceed to delete the file since the file no longer bound to the variable.