0

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?

Barnabeck
  • 459
  • 1
  • 6
  • 26

1 Answers1

0

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.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • I would love to build a solution based on some free api, but I have spent entire days without finding anything. All these consideration don't bother me at all. No Office licence issues with our users. No important instabilities occur. The solution had been running great for some 8 years, so I got imune to these kind of considerations. It bundles seperate WORD and EXCEL pages in one PDF binder. Now that I move the service to another server I get this error and do not understand why the app tries to get access to CLSID {000209FF...} which is nowhere on the server, and not to Word {00020906..} – Barnabeck Oct 11 '22 at 10:30
  • That's the {000209FF-0000-0000-C000-000000000046} class id (CLSID) for "Word.Application" (version independent ProgId). Do you have Word installed on the system? Have you tried reinstalling MS Office? – Eugene Astafiev Oct 11 '22 at 11:21