Reputation: 1
Microsoft.Office.Interop.Outlook.Application outlookObj;
outlookObj = new Microsoft.Office.Interop.Outlook.Application();
At start of the program gives out a mistake
{ "It wasn't succeeded to receive factory of the class COM for a component with CLSID {0006F03A-0000-0000-C000-000000000046} because of the following mistake: 80080005 Mistake at implementation of the appendix server (An exception of HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))." }
In what the mistake consists?
Upvotes: 0
Views: 58
Reputation: 49455
In case if you run the code on the server-side or from any non-interactive client:
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution.
You can read more about that in the Considerations for server-side Automation of Office article.
Upvotes: 0
Reputation: 66316
CO_E_SERVER_EXEC_FAILURE usually means that your code and Outlook are running in different security contexts. Is either app running with elevated privileges (run as administrator)? Is your app running as a service?
Upvotes: 0