1

I have a problem with a Outlook solution - it worked fine with Office 2007-2013. We recently updated Office to Version 2016 and now we get an error. I don't understand why, we use the Interop.Outlook.dll from Visual Studio 2015(Office2013/2016 Add-in).

We cannot downgrade because Office 365 does not allow it anymore.

I get a runtime error:

InvalidCastException; Unable to cast COM object of the type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface 'Microsoft.Office.Interop.Outlook._Application'. Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)

using Outlook = Microsoft.Office.Interop.Outlook;

Outlook.Application app = null;
Outlook.Namespace ns = null;

app = new Outlook.Application();
ns = app.GetNameSpace("MAPI"); -> this is where the exception is thrown.

Can you please explain why i get this error and maybe give me a tipp, solution or workaround? :) Best regards,
Stefan

Krunal
  • 77,632
  • 48
  • 245
  • 261
Stefan M.
  • 11
  • 3
  • Does https://social.msdn.microsoft.com/Forums/vstudio/en-US/ac50fa41-8d47-4fa9-81a3-914f262676af/0x80029c4a-typeecantloadlibrary?forum=vsto or https://support.boyum-it.com/hc/en-us/articles/206772337-Outlook-issue-Unable-to-cast-COM-object-of-type-Microsoft-Office-Interop-Outlook-ApplicationClass- help? – mjwills Jun 26 '17 at 13:02
  • 1
    @mjwillis: thy a lot - it looks like my libtype was corruped - the strange thing is i never downgraded Office on that PC - repair Office should solved it - i will write again if its completly solved, after finishing changes to code ;) – Stefan M. Jun 26 '17 at 14:48

0 Answers0