Retrieving the COM class factory for component failed due to the following error: 800702e4.

Posted by Anuraj on Thursday, May 2, 2013

.Net .Net 4.0 Office Interoperability Visual Studio Windows Forms

While working on some outlook C# application I got a COM exception like this.

Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005.

Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 800702e4.

My code was simply straight forward, I was just creating the instance of the outlook application.

var oApp = new Outlook.Application();

And this code was used in a different application which works without any issue. Later I found the solution for the problem. The culprit was UAC. I was running the Visual Studio as Administrator. So the conclusion is, when automating an Office application from another application, both the application should be run in same privilege level. If you are running Visual Studio as Administrator, you should run the office application also in Administrator mode.

Happy Programming.



Did you like this article? Share it with your friends

Facebook Twitter Google+ LinkedIn Reddit StumbleUpon



MVP
Subscribe


Copyright © 2017 - Anuraj P. Blog content licensed under the Creative Commons CC BY 2.5 | Unless otherwise stated or granted, code samples licensed under the MIT license. This is a personal blog. The opinions expressed here represent my own and not those of my employer. Hosted with ❤ by GitHub