user2615257
user2615257

Reputation: 1

Word document error

I am trying use a Word document from my application on a Windows 2008 server 64bit from my MVC 2 application. I encountered this error message:

System.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.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic).

I have tried all know solutions, but still cannot fix it.

Upvotes: 0

Views: 110

Answers (1)

sky
sky

Reputation: 441

First of all, please note that serverside office interop isn't officially supported by Microsoft: http://support.microsoft.com/kb/257757

Nevertheless I got a similar scenario running with power point and had to do the following steps to get rid of the error you describe:

  1. Run Microsoft Management Console (mmc.exe)
  2. Add Snap-In for "Component Services"
  3. Search for Computers\My Computer\DCOM Config\Microsoft Office Power Point Slide\ (you may search for something that sounds correct for your word-scenario)
  4. Open Properties > Tab "Security"
  5. "Launch and Activation Permissions" > Edit ...
  6. Add your application pool user to this list and allow "Local Launch" and "Local Activation"

Upvotes: 1

Related Questions