Answered by:
Word Interop deployment on server- 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)).

Question
-
Hi,
I have installed interop assembly on server but receiving following exception after hosting inside IIS -
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)).
I have tried on both Windows Server 2012 & Windows Server 2008 R2.
I have tried to provide access to IIS user, network service user as well as everyone inside component services - DCom Config - Microsoft Word 97 - 2003 Properties but nothing worked till now.
Any solution would be great help to resolve this issue.
ThanksTuesday, January 19, 2016 7:21 AM
Answers
-
Hello Saurabh,
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.As a workaround you may consider using the Open XML SDK, see Welcome to the Open XML SDK 2.5 for Office. Or just any third-party components designed for the server side execution.
- Marked as answer by saurabh nawathe Wednesday, January 20, 2016 5:46 AM
Tuesday, January 19, 2016 8:06 AM
All replies
-
Hello Saurabh,
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.As a workaround you may consider using the Open XML SDK, see Welcome to the Open XML SDK 2.5 for Office. Or just any third-party components designed for the server side execution.
- Marked as answer by saurabh nawathe Wednesday, January 20, 2016 5:46 AM
Tuesday, January 19, 2016 8:06 AM -
Hello Saurabh
This is basically a access related issues, Most of the time, we install 32bit office on 64bit OS. to give full access to INTEROP object follow below workarounds
1. Workaround
- Go to Start -> Run.
- Type DCOMCNFG. (This will load the "Component Services")
Go to Component Services -> Computers -> My Computer -> DCOM Config ->
Wordà security tab à give access
If MSWord not found in DCOM Config then
Run window type MMC -32
File à add/Remove snap in à
à Add component services
à Computers
à My Computer
à DCOM Config
à Microsoft Excel Application / Microsoft Word Application
Give access local services, Administrator
2. Workaround
Create a new "Desktop" directory inside of “C:\Windows\SysWOW64\config\systemprofile\" and give access (This solutions works on windows 7 also)
3. Workaround
- open registry editor (regedit)
- Search for winword.exe, copy the AppId/Guid for word from “HKEY_CLASSES_ROOT\AppID\WINWORD.EXE”
- Open Compent Services (dcomcnfg), Go to Computers->MyComputer->DCOM Cnfg
- Select the application with the guid copied from registry.
- Right click on it, select properties, select Identity tab, select “Interactive User”, click on “Apply” button.
Hope it helps
- Proposed as answer by koolprasadd Wednesday, January 27, 2016 11:17 AM
Tuesday, January 19, 2016 12:30 PM -
hello,
have you found a solution for your problem ?
have a good day
Thursday, July 30, 2020 1:26 PM