0
votes

UiPath Community, I am unable to utilize any of my Outlook automations using UiPath StudioX. Whenever I run the sequence, I encounter the following error message: "RemoteException wrapping System.Reflection.TargetInvocationException: Property accessor ‘Account’ on object ‘UiPath.Mail.Activities.Business.OutlookApplicationCard’ threw the following exception:‘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).’ —> 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: Interface not registered (Exception from HRESULT: 0x80040155). "

I would highly appreciate your help and explanation to resolve the problem.

enter image description here

1

1 Answers

0
votes

It seems your windows registry keys are messed up. This is a widely spread issue when dealing with COM libraries. Here is what the Error: Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop.Outlook._Application'. thread states:

Sounds like you have a problem with your typelib registration. Presumably, the Com interop layer is hitting the registry to try to locate the typelib. It would start by looking under HKCR\Interface{00063001-0000-0000-C000-000000000046}\Typelib. The default value should refer to the guid for the typelib that defines the interface in question: which should be located under the following key: HKCR\Typelib{00062FFF-0000-0000-C000-000000000046}. There should be a version subkey and then a 0 subkey, and a win32 subkey under that. The default value of the win32 key should point to the typelib (which is msoutl.olb).

I'd recommend you check your Office directory for msoutl.olb. If it is there, try running 'regtlib msoutl.olb'. You should have regtlib on your machine is part of your Visual Studio install, I believe. Anyway, reregistering the typelib will rewrite all of the necessary keys to the registry. You will need administrative privileges for this operation.

The other possibility is that msoutl.olb itself is corrupt, in which case reinstalling Outlook should fix the problem.

Try to "repair" your Microsoft Office installation. Go to Programs and Features, select Modify and then Repair Online.

FYI I'd recommend contacting UiPath StudioX for further troubleshooting.