Save Image Failed while running inside loop

activities
image

#1

Hi guys!
My steps:

  1. Take screenshot activity to capture the screenshot.
  2. Save image activity to save the image.
  3. Send email activity to send the screenshot as an attachment.

Note: When ever i am running the artifact, for the first loop it is performing correctly. But when it executes for the second time inside the same loop, i am getting this following error.

UiPath.Core.ImageOperationException: Save image failed. Check if the file name is a valid path —> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.

I have tried many times but it is throwing the same error.

Please help me out how to handle this situation.

Regards,
Jiban


#2

Hi,
All looks fine.:slight_smile:
Could you please attach workflow.


#3

Thanks for your response @ddpadil
Sorry, i cannot attach the workflow here.
Let me know which activity and properties you need to check so that i can provide the screenshot.

Thanks,
Jiban


#4

Take Screen shot and save image activities.
can’t analyse much by screenshots. :frowning:


#5

Hi guys!
My steps:

Take screenshot activity to capture the screenshot.
Save image activity to save the image.
Send email activity to send the screenshot as an attachment.
Note: When ever i am running the artifact, for the first loop it is performing correctly. But when it executes for the second time inside the same loop, i am getting this following error.

UiPath.Core.ImageOperationException: Save image failed. Check if the file name is a valid path —> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.

I have tried many times but it is throwing the same error.

Please help me out how to handle this situation.


#6

what studio version do you use?


#7

Please save the file with a different name each time. May be you can add date and time. And add 2 seconds delay before sending email, if it is immediately next activity.
It happens because of the file being used by a process.
Let me know, if it works.
Thanks.