C # solve the problem of IIS Excel write permission

Source: Internet
Author: User

The configuration method is as follows:

1: Install the Excel software for office on the server.
2: Enter dcomcnfg.exe in "start"-> "run" to start "Component Service"
3: Double-click "component service"> "computer"> "my computer"> "DCOM configuration"
4. In "DCOM configuration", find "Microsoft Excel application", right-click it, and click "properties". The "Microsoft Excel application properties" dialog box is displayed.
5. Click the "ID" tab and select "Interactive User"
6. Click the "Security" tab, click "Custom" on "Start and activate Permissions", and then click the corresponding "edit" button, in the pop-up "security" dialog box, add a "NETWORKSERVICE" user (Be sure to select this computer

And grant it the "local startup" and "Local activation" permissions.
7: the "Security" label remains. Click "Custom" on "Access Permissions", and then click "edit ", in the pop-up "security" dialog box, add a "NETWORKSERVICE" user and grant "local access" permission.
In this way, we have configured the corresponding Excel DCOM permissions.
Note: I configured it on WIN2003 and configured the ASPNET user on 2000.

If no configuration is performed, an error occurs.
Failed to retrieve components whose CLSID is {00024500-0000-0000-C000-000000000046} in the COM class factory because of the following error: 80070005.
The reason is that the user does not have the permission to use Excel.
To export to word, you also need to configure the permission to use word.

Failed because: 80070005
Symptoms:
OWordApplic = New Word. Application
When the program runs this sentence, the following error occurs:
Failed to retrieve components whose CLSID is {000209FF-0000-0000-C000-000000000046} in the COM class factory because of the following error: 80070005.
OWordApplic = New Word. Application
When the program runs this sentence, the following error occurs:
Failed to retrieve components whose CLSID is {000209FF-0000-0000-C000-000000000046} in the COM class factory because of the following error: 80070005.
Solution 1:
Control Panel-> Administrative Tools-> component services-> Computer-> my computer-> DCom configuration-> Microsoft Word documents
After
Click properties to open the Properties dialog box for this application.
2. Click the ID tab and select an interactive user.
3. Click the "Security" tab, select "Custom" in the "Start and activate Permissions" and "Access Permissions" groups, and then
Custom-> edit-> Add ASP. NET account and IUSER _ computer name

* These accounts only exist when IIS is installed on the computer.
13. Make sure that each user is allowed to access the service and click OK.
14. Click OK to disable DCOMCNFG.

Solution 2:
If the above method cannot solve the problem, it should be a permission problem. Please try the following method:
Use identity simulation in web. config and add <identity impersonate = "true" userName = "your userName" password = "password"/> In the <system. web> section.
</System. web>

<Identity impersonate = "true" userName = "your userName" password = "password"/>
In this example, the Super User test is passed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.