C # Troubleshoot IIS write Excel permissions issues _c# Tutorial
Source: Internet
Author: User
The specific configuration method is as follows:
1: Install Office Excel software on the server.
2: In the "Start"-> "Run" Enter Dcomcnfg.exe start "Component Services"
3: Double-click "Component Services"-> "Computer"-> "My Computer"-> "DCOM Configuration"
4: Locate "Microsoft Excel Application" in "DCOM Configuration", right-click on it, and click "Properties" to eject the "MicrosoftExcel Application Properties" dialog box
5: Click on the "Logo" tab, select "Interactive User"
6: Click on the "Security" tab, "Start and Activate Permissions" on the "Custom", and then click the corresponding "Edit" button, in the pop-up "Security" dialog box to fill in a "NetworkService" User (note to select this computer
Name) and gives it "local start" and "Local Activation" permissions.
7: Remain the "Security" tab, click "Customize" on "Access", then click "Edit", and add a "NetworkService" user in the Pop-up Security dialog box, and give "local access" permission.
In this way, we have configured the appropriate Excel DCOM permissions.
Note: I was configured on the WIN2003, on 2000, to configure the ASPNET user
Errors will occur if no configuration is made
Retrieving a component with a CLSID of {00024500-0000-0000-c000-000000000046} in a COM class factory failed because the following error occurred: 80070005.
The reason is that the user does not have permission to use Excel.
Exporting to Word also configures the permissions to use Word.
failed because the following error occurred: 80070005
Symptoms:
Owordapplic = New Word.Application
The following error occurred while the program was running into this sentence:
Retrieving a component with a CLSID of {000209ff-0000-0000-c000-000000000046} in a COM class factory failed because the following error occurred: 80070005.
Owordapplic = New Word.Application
The following error occurred while the program was running into this sentence:
Retrieving a component with a CLSID of {000209ff-0000-0000-c000-000000000046} in a COM class factory failed because the following error occurred: 80070005.
Workaround One:
Control Panel-"Management tools-" Component Services-"computer-" My Computer-"DCOM configuration-" Find a Microsoft Word document
After
Click Properties to open the Properties dialog box for this application.
2. Click the Identification tab, and then select the 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 if IIS is installed on the computer.
13. Ensure that each user is allowed access, and then click OK.
14. Click OK to close DCOMCNFG.
Workaround Two:
If the above method does not resolve the problem, it should be a permission issue, please try the following method:
Using identity simulations in web.config, add <identity impersonate= "true" username= "your username" password= "password" in the <system.web> section/>
</system.web>
<identity impersonate= "true" username= "your username" password= "password"/>
Here I use the Super User test--through the
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.