0
votes

I want to set up a robot able to send e-mails thank's to the UIPATH activity "Send Outlook Mail". but a receive this error message :

Send Outlook Mail 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).

Some people on internet seem to have managed to correct this problem due to the versioning of Outlook. But my problem seems different because I only have the versions 8.7 listed in the IID : HKEY_CLASSES_ROOT\TypeLib{00020905-0000-0000-C000-000000000046}

1
Did you use the Click2Run edition of MS Office? What version do you have installed?Eugene Astafiev
Yes I did, I have the "Microsoft 365 Apps for enterprise" version 2105 .Xodarap

1 Answers

0
votes

It seems your windows registry records are messed. Try to "repair" your Microsoft Office installation. Go to Programs and Features, select Modify and then Repair Online.

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'. forum 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 checking 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.

Also you may find the Outlook issue - Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' page helpful.