Error with interop.word.dll library

0

I have the following error when using the interop.word.dll library. Can someone help me solve it?

  

[UnauthorizedAccessException]: 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)).          at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject (RuntimeType   objectType)          at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance (RuntimeType   serverType)          at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK (RuntimeType   serverType, Object [] props, Boolean bNewObj)          at System.RuntimeTypeHandle.CreateInstance (RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean & canBeCached,   RuntimeMethodHandleInternal & ctor, Boolean & bNeedSecurityCheck)          at System.RuntimeType.CreateInstanceSlow (Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark & stackMark)          at System.Activator.CreateInstance (Type type, Boolean nonPublic)          at System.Activator.CreateInstance (Type type)          at SGPJ.DownloadFile.Merge (String [] filesToMerge, String outputFilename, Boolean insertPageBreaks, String documentTemplate,   String nsec_aop, DataTable tbl Requirements)          at SGPJ.DownloadFile.GenerateProtocol3 (String nsecAop)          at SGPJ.DownloadFile.Page_Load (Object sender, EventArgs e)          at System.Web.UI.Control.OnLoad (EventArgs e)          at System.Web.UI.Control.LoadRecursive ()          at System.Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    
asked by Nery Carrizales 18.07.2018 в 14:20
source

1 answer

0

to me the following I find for an error of the access denied type with the same library:

From Run (Win + R) place DCOMCNFG (which opens the component services interface) and then perform these steps:

1) Then go to Console Root > Component Services > Teams, right click on My Computer, and select Properties.

2) Then on the Security tab COM > Start and activation permissions, choose "Edit default values"

3) Add the user with whom the application is running, for example if you use asp.net hosted in IIS, add the user IIS_IUSRS or the service with which it is executed.

4) And finally in the permissions, check local execution and local activation.

With this I had no more access problems denied with the Office libraries.

Greetings!

    
answered by 25.07.2018 в 17:24