Retrieving the COM class factory for a component is denied, but I can't locate that component

654 Views Asked by At

I have a .not web application that uses Office INTEROP to automate certain processes that run on the server. I'm aware that this is not recommended by Microsoft, but the solution had been working great for years now and I'm using it only in our Intranet. I'm now moving the solution from Windows Server 2012 to 2019 while Office keeps being version 2016.

When I run the application I get the (very well known) error: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

Usually this Error popped up after any Windows Update, as my customized component security settings would be eliminated on that occasion, so I'm pretty familiar to that error.

What is different now is the fact that I can't find any matching guid in the component list. Word has CLSID {00020906-0000-0000-C000-000000000046}... so there is a slight difference.

Any suggestions on how to handle this?

1

There are 1 best solutions below

2
Eugene Astafiev On

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.

Read more about that in the Considerations for server-side Automation of Office article.