Outlook Interop Exception

interface not registered (exception from hresult: 0x80040155)
unable to cast com object of type 'microsoft office interop outlook applicationclass

Trying to automate Outlook as

Microsoft.Office.Interop.Outlook.Application myApp = new Microsoft.Office.Interop.Outlook.ApplicationClass();    
Microsoft.Office.Interop.Outlook.NameSpace mapiNameSpace = myApp.GetNamespace("MAPI");

and getting following exception at second line i.e. GetNamespace

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: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

I am using .Net Framework 4 and Outlook 2013.

Is this the only solution!!! as I am trying to avoid making any changes to the registry.

Edit

this didn't fix the problem.

Edit If the referenced library is Office 15 and the installed library is 10 or 12, would it work?

I've been stumped by this problem for days. This worked for me:

I just realized that Outlook 2013 is 64 bit... And my C# app had in Project Properties -> Build "Any CPU" as platform target and a check-mark in "Prefer 32-bit".

I changed the Platform target to x64 and it worked!

Exception Interface (Microsoft.Office.Interop.Outlook), represents the parent Outlook application for the object. Read-only. C++. Copy. public: property Microsoft::Office::Interop::Outlook::Application ^ Application� Outlook Interop Exception - HRESULT 0xCA140115. Microsoft Office for Developers > Outlook for Developers. Outlook for Developers https://social.msdn.microsoft.com

The exception looks quite obvious, this should work

    var myApp = new Microsoft.Office.Interop.Outlook.Application();

you just can't get a cast exception with that line above.

Exception.Application Property (Microsoft.Office.Interop.Outlook , Interop.Outlook._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063001-� Hello, I'm working on a client tool that should send mail. I have decided to use Outlook Interop to do so and it works fine if outlook is running otherwise I get the: "Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))" Exception on the ResolveAll() method

This exception usually happens when you had two versions of Office installed and then uninstalled one. Run a repair installation for your still installed Office, this should fix the registry keys.

(Exception from HRESULT: 0x80040155) - Outlook , Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office. error: Interface not registered (Exception from HRESULT: 0x80040155). (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY) Follow the below mentioned steps to remove the invalid registry key in order to resolve this Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' issue: Close all instances of Microsoft Office product.

have you tried this?

Microsoft.Office.Interop.Outlook.Application myApp = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.NameSpace mapiNameSpace = myApp.GetNamespace("MAPI");

When trying to use Outlook integration with the desktop version and , Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop. Outlook._Application'. (Exception from HRESULT: 0x80029C4A� The runtime automatically maps the HRESULT from COM interop to more specific exceptions. For example, E_ACCESSDENIED becomes UnauthorizedAccessException, E_OUTOFMEMORY becomes OutOfMemoryException, and so on. If the HRESULT is a custom result or if it is unknown to the runtime, the runtime passes a generic COMException to the client.

The fix of the 9.5 version didn't work for me, as there was no excessive 9.5 field.

In my case, the problem was that when I downgraded to Outlook 2010 I have modified the installation location (i.e. not in the default ProgramFiles folder). However, windows didn’t update accordingly the value in ‘HKEY_CLASSES_ROOT\TypeLib{00062FFF-0000-0000-C000-000000000046}\9.4\0\win64’.

After manually updating the value and pointing it to the right location, the problem was resolved.

Error: "Unable to cast COM object of type 'Microsoft.Office.Interop , InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook.MAPIFolder'. This operation� However, i tried this and the exception is thrown once again var myApp = new Microsoft.Office.Interop.Outlook.Application(); var mapiNameSpace = myApp.GetNamespace("MAPI"); – bjan Aug 26 '13 at 11:26

"System.InvalidCastException" error or emails get stuck in the Outbox, Interop.Outlook._Application.' This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063001-0000-0000- C000� Outlook Error: Could not load file or assembly 'Microsoft.Office.Interop.Outlook, Version=12.0.0.0 Outlook Error: HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)) CRM for Outlook Add-In keeps disabling

Error 'Library not registered (Exception from HRESULT , Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop. Outlook._Application'. (Exception from HRESULT: 0x80029C4A� I simply cannot get C# in VS 2017 to work with Outlook 2016 Interop. I have tried checking the registry, repairing Office, etc. I tried it on my assistants computer, and it doesn't work either.

Outlook issue, Interop.Outlook 15.0.0.0. When running in Debug mode everything works fine but crashes in Release mode with Exception: Unable to cast COM object of type� Hi! I am having a problem with the code in my Revit Add-in. In the code I use the Microsoft.Office.Interop.Word to make some changes in a Word document and then save it. All this works perfectly on my machine and on other 4 test machines. For some reasons one of the users is getting an error: With R

Comments
  • trying stackoverflow.com/questions/4656360/…
  • Wow, this fixed my issue after upgrading Office. The error message isn't really all that clear, weird thing is that I was using 64bit before and it was working fine. Thanks!
  • The exception is being thrown while getting namespace i.e. myApp.GetNamespace. However, i tried this and the exception is thrown once again var myApp = new Microsoft.Office.Interop.Outlook.Application(); var mapiNameSpace = myApp.GetNamespace("MAPI");
  • there is no question. I was offering what may be a solution to the problem :)