System.UnauthorizedAccessException: Retrieving the COM class factory for Word Interop fails with error 80070005

后端 未结 10 1151
无人及你
无人及你 2020-11-27 16:01

I have a problem with a C# ASP .NET project in Visual Studio 2008 This problem started when I reinstalled my computer with Windows 7 Ultimate (x64). To this I\'m also using

相关标签:
10条回答
  • 2020-11-27 16:43

    This worked for me:

    1. In the command line put DCOMCNFG
    2. Component Services -> Computers -> My Computer -> DCOM Config
    3. Find "Microsoft Word 97 - 2003 Document" (If it is missing check if your Word is also 64 bit)
    4. Right click -> Properties
    5. Go To Tab Security and Edit the "Customize" radio buttons so that IIS_IUSRS could have rights for launch and access
    6. Go to Tab Identity and choose "The interactive user"
    7. Apply changes and try again
    8. If all this fails, go also to tab "General" and in "Authentication Level" drop down choose "None".
    0 讨论(0)
  • 2020-11-27 16:53

    Here is my fix for this problem:

    I'm using Win 7 64bit and Office 2007

    Run program "dcomcnfg -32". ( You cant find the word and excel components if it runs under 64bit)

    Go to "Console Root/Component Services/Computer/My Computer/DCOM Config/" Look up Microsoft Word and Excel and choose properties.

    Go to Security and select "Customize" under "Configuration Permissions. (If needed you might want to change the other permissions as well, but I didn't need to) Add "IIS_IUSRS" and give it "Full Control".

    Now go to "Identity" and select "The interactive user".

    Do not forget to press "OK" when done. :D

    I Hope this helps you with your problem and also the rest who gets here and read this.

    0 讨论(0)
  • 2020-11-27 16:55

    I test all above methods that also marked as answer but in windows server when user is not active or logoff, get access exception. so:

    1. I created a user on local computer and add it to two group: IIS_USER and Administrator
    2. Component Services -> Computers -> My Computer -> DCOM Config
    3. In com+ object i change to run Microsoft Word 97 – 2003 Document component with this user. See it here
    4. also add IIS_USER and also Application-identity user (IIS APPPool\[Name]) to all three section on security section and make the full permission as possible. See it here

    office will run with settings from user that you create in first step, so if you change any setting with this user. 120% Working with no problem. tried over 3 different server.

    0 讨论(0)
  • 2020-11-27 16:57

    Go to registry HKCR>TypeLib>{00020905-0000-0000-C000-000000000046}>8.7>0, then delete the folder "win32" this is for Word COM Class error.

    Go to registry HKCR>TypeLib>{00020813-0000-0000-C000-000000000046}>1.9>0, then delete the folder "win32" this is for Excel COM Class error.

    Try that method that method fixed my problem.

    0 讨论(0)
提交回复
热议问题