Retrieving the COM class factory for component with CLSID failed

venkatesh padmanabhan 181 Reputation points
2022-04-26T09:30:54.523+00:00

Hi.
I am using windows server 2019 standard, 64 gb, x64 system. The visual studio version is VS 2019- 16.9.4.

I am trying to use the Interop.word.application in the console solution code . I have added the reference to microsoft.office.interop.word version 16.0 . The word version in my server is 2016.

Application wordApp = new Application();

When the line hits this, i am getting error as :
Retrieving the COM class factory for component with CLSID {GUID} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).

The same code is working in different machine and i tried using a console application. How to fix this issue in server ?
Thanks

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,204 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,459 questions
{count} votes