Outlook send Mail Error

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).

I try many method to solve it, but all of them are failure: run office repair tool in unipath / uninstall office and re-start the computer, then install office again. Please help to advice how to solve this problem, thanks.

Hi @alison.guo

Confirm that outlook application is installed in your local computer.
If not installed do install the outlook application. If you are using outlook activities the outlook application has to be installed in machine.

Hope it helps!!

Hi @alison.guo ,
check open outlook in your PC
regards,
LNV

Hi @alison.guo

Please check on this

I have repaired office and the registry file looks like fine, only 9.6 key under HKEY_CLASSES_ROOT\TypeLib{00062FFF-0000-0000-C000-000000000046}. but the problem still is happened.

no, the error still is happened.

can you share image about that error?

i have re-installed office, and outlook activity is install in UiPath, but same error is happened.


23.6.1-beta.13324+Branch.release-v23.6.1.Sha.52787b786620e97cba5555379da6e6bb423b3e6b

Source: 生成邮件

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

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 System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Interop.Outlook.ApplicationClass.get_Version()
at UiPath.Mail.OutlookAPI.InitOutlook()
at UiPath.Mail.OutlookAPI.SendMailInternal(MailMessage mailMessage, String account, String sentOnBehalfOfName, String to, String cc, String bcc, List1 attachments, Boolean isDraft, Action1 SetBody)
at UiPath.Mail.OutlookAPI.SendMail(MailMessage mailMessage, String account, String sentOnBehalfOfName, String to, String cc, String bcc, List`1 attachments, Boolean isDraft, Boolean isBodyHtml)
at UiPath.Mail.Outlook.Activities.SendOutlookMail.<>c__DisplayClass32_0.b__0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at UiPath.Mail.Outlook.Activities.SendOutlookMail.d__32.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Mail.Activities.Extensions.TaskExtensions.d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Mail.Activities.SendMailActivity.d__43.MoveNext()
— End of stack trace from previous location where exception was thrown —
at UiPath.Shared.Activities.AsyncTaskCodeActivityImplementation.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at UiPath.Shared.Activities.AsyncTaskCodeActivity.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 see your error
you can check


update newest ver
then try again
regards

Hi @alison.guo ,
You can check

you can erase from the registry the key
00063001-0000-0000-C000-000000000046
now it is just saying that
Send Outlook Mail Message : Object reference not set to an instance of an object.
regards.

unfortunately, error still happened. For your information, the process is run normally before. I do not change anything, but it is not work from this week.

Oh, you can check that

it is not worked, thanks.