I’m facing the following error message when I try to send a message using Outlook method :
Source: Send Outlook Mail Message
Message: Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop.Outlook._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063001-0000-0000-C000-000000000046}' failed due to the following error: Interface not registered (Exception from HRESULT: 0x80040155).
Exception Type: System.InvalidCastException
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.InvalidCastException: Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop.Outlook._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063001-0000-0000-C000-000000000046}' failed due to the following error: Interface not registered (Exception from HRESULT: 0x80040155).
at UiPath.Mail.Activities.SendMailActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
After some search I’m still unable to find the exact cause of this error…
Threads found on this forum or technet (this problem is related to Microsoft product, not limited to UIPath visibly) are not working.
Windows 7 64bits
Office 2013 64bits
UIPath 2018.4.4
Any idea to solve this issue ?
In the same time I tried to simply access to the mailbox using the activity Get Outlook Mail Messages. And this one failed with another message :
Source: Get Outlook Mail Messages
Message: The specified folder does not exist
Exception Type: System.ArgumentException
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.ArgumentException: The specified folder does not exist
at UiPath.Mail.Activities.GetMailActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
Here, visibly, UIPath can access to Outlook object but don’t recognize any folder name. I tried “Inbox”, “Boîte de réception” (as displayed in Outlook), “Sent”, “Draft” etc… Nothing work…
Source: Get Outlook Mail Messages
Message: The specified folder does not exist
Exception Type: System.ArgumentException
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.ArgumentException: The specified folder does not exist
at UiPath.Mail.Activities.GetMailActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
I tried to access to Outlook via VBS and no problem in this case, I could access to “Inbox” or “Sent” folders for example. Could-it be something specific to .Net framework configuration ?
Unfortunately as new comer I cannot upload file, so I copy/paste here the code :
It’s a test so the first activity is a “Get Outlook Mail Messages” (just drag/dropped on the Sequence). The second one (disabled actually) is my first attempt to send a mail using Outlook. I just change the To address field which is normally my email address
Try reinstallling the mail activities (UiPath.Mail.Activities) again in the manage packages available at the top in the ribbon. And try the workflow i send earlier.
Sorry for the delay.
Yes, I contact the support for this problem and tried anything I could to find a solution. But nothing worked…
No problem detected into the registry, full install of Office 2013 or repair didn’t changed anything.
So in a last attempt before adopting a “Plan B”, we installed UIpath onto a VM with Windows 10 + Office 2016.
And… Ok, one good news and one bad !
The good is that send a email activity is working now So the problem was really linked to the installation of the system in my company. No idea on the root cause by the way…
The bad, yes because it cannot be so simple, there is a bug with the AV installed (Symantec Endpoint Protection) which is not recognized as a valid antivirus software. And for Outlook 2016, no valid antivirus imply no access to the mailbox without warning message asking the user to validate the access for a defined amount of time… Bad Symantec :-/