Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop.Outlook._Application'. - element not found

Hello,

I’m trying to send an outlook email using StudioX and today I got the following error:

20.10.2+Branch.master.Sha.cf481ddc1ae94ab83e743f85d96fbfeca8fc705c
Source: Use Outlook Account
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: Element not found. (Exception from HRESULT: 0x8002802B (TYPE_E_ELEMENTNOTFOUND)).

Exception Type: System.InvalidCastException

RemoteException wrapping 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: Element not found. (Exception from HRESULT: 0x8002802B (TYPE_E_ELEMENTNOTFOUND)).
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.Outlook.OutlookAccountWithStoreDetectionService.GetLocallyMappedStoreAccounts()
at UiPath.Mail.Outlook.OutlookAccountWithStoreDetectionService.GetAccountDisplayName(String accountWithStoreName)
at UiPath.Mail.Activities.Business.OutlookApplicationCard.Execute(NativeActivityContext context)
at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

I tried using the Microsoft Office Tools repair, but that did not solve the problem. This worked just last week, so I’m not quite sure what caused it to break today.

Any help would be greatly appreciated.

Are your packages up to date in StudioX? You may want to try updating to the latest versions to see if it resolves it.

Thanks, Andy. Updates to StudioX are managed by my IT organization, so I can’t do much about that. I’ve downloaded an updated version of the StudioX Outlook repair tool, and that did not resolve the issue.

Based on what I have read about this error it seems to be an error from the underlying Microsoft COM library.

One of the recommendations is to repair the office installation and try.

Thanks