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