File in use - Send Outlook messages

Greetings. I’m having this problem when trying to send an Outlook mail message containing an attachment, in which it says that the file is being used by another program. This is causing the “send outlook message” activity to fail and I see no other program but uipath “using” the file.

Have any of you ever faced this problem?

Hi
Before using SEND OUTLOOK MAIL ACTIVITY use a KILL PROCESS ACTIVITY and mention the ProcessName Property as “EXCEL”

Cheers @sebaaf96

Thanks for the quick response.
I’ve already tried that, but it keeps happening.

Add some delay as well
Cheers @sebaaf96

I’m currently using 10 secs, but I’ll try adding more delay and see.
I’ve also tried adding a Try-Catch to the activity and a “click” activity inside the catch box so to click “OK” in case the message appears, but didn’t work apparently.
In my mind it makes sense to manage the exception that way, the only reason why it still fails may be that the click activity is actually not clicking.
I will try more strategies and see.
Thank you

So you mean you are trying to access the mail application from front end UI
if so use ELEMENT EXISTS activity and check for that element and if that appears get the Boolean variable as output
Then use IF condition and validate that and then Use SEND HOT KEY activity with key as enter

Cheers @sebaaf96

1 Like

So… it took me long to understand the underlying problem…

We were having this problem in which orchestrator won’t automatically unlock the windows session when it was locked. I found that this problem related to sending emails only happened when the robot worked with the session locked.

Now that we solved the orchestrator problem, the session is always active and hence this problem is not happening anymore. However, I still can’t understand why it failed anyway… Isn’t the “Send Outlook Messages” supposed to work in background?
Maybe it has something to do with Excel not being able to close correctly while the session was locked…

What do you think?

I think it’s not because of send outlook mail activity as far as I know, rather could be due to some other reason
By chance did we check with the log in orchestrator once after running the Job from orchestrator

We can find the reason why it got errored out and where it throws this error

Cheers @sebaaf96