Office Interop Issue on Windows Server

偶尔善良 提交于 2019-12-12 02:41:38

问题


I am trying to access the Word Office Interop on a server from my aplication using the following line:

Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application();

This however causes an exception to be throw:

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)).

Does anyone know what I can do to allow my program to access this?


回答1:


You need to grant permission to 'Launch and Activate' for the user running IIS.

Start-->Run-->dcomcnfg

Under Component Services\Computers Right-Click 'My Computer'

Permissions are under COM Security



来源:https://stackoverflow.com/questions/7558076/office-interop-issue-on-windows-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!