c resolves permission issues for IIS to write Excel

  • 2020-05-07 20:19:34
  • OfStack

The specific configuration method is as follows:

1: install Excel software of office on the server.
2: at the beginning > In run, enter dcomcnfg.exe to start component services
3: double-click "component services "- in turn > "Computer "- > "My computer" -- > "DCOM configuration"
4: find "Microsoft Excel application "in "DCOM configuration ", right click on it, then click" properties ", the "MicrosoftExcel application properties "dialog box pops up
5: click the "identify" TAB and select "interactive user"
6: click the "security" TAB, click "customize" on the "start and activate permission ", then click the corresponding" edit "button, fill in 1 "NETWORKSERVICE" user in the" security "dialog box

Name) and give it "local start" and "local activation" privileges.
7: still the "security" TAB, click "customize" on "access ", then click" edit ", in the "security" dialog box also fill in a "NETWORKSERVICE" user, and then grant "local access" rights.
In this way, we have configured the DCOM permissions for the corresponding Excel.
Note: I configured it on WIN2003, and on 2000, ASPNET users

An error will occur if you do not configure
The failure to retrieve the component in the COM class factory where CLSID is {00024500-0000-0000-C000-000000000046} was due to the following error: 80070005.
The reason is that the user does not have permission to use Excel.
Exporting to word also requires configuring permissions to use word.


Failure due to the following error: 80070005
Symptoms:
oWordApplic = New Word.Application
The following error occurs when the program runs to this sentence:
Failure to retrieve a component in the COM class factory where CLSID is {000209FF-0000-0000-C000-000000000046} due to the following error: 80070005.
oWordApplic = New Word.Application
The following error occurs when the program runs to this sentence:
The failure to retrieve a component in the COM class factory where CLSID is {000209FF-0000-0000-C000-00000046} was due to the following error: 80070005.
Solution 1:
Control panel - management tools - component services - computer - my computer - DCom configuration - find the Microsoft Word documentation
after
Click properties to open the properties dialog box for this application.
2. Click the identity TAB, and then select the interactive user.
3. Click the "security" TAB, select "custom" in the "start and activate permissions" and "access permissions" groups, respectively, and then
The custom - > Edit - > Add ASP.NET account and IUSER_ computer name

* these accounts exist only if IIS is installed on the computer.
13. Make sure that each user is allowed access, and then click ok.
14. Click ok to close DCOMCNFG.

Solution 2:
If the above method does not solve the problem, it should be a permission problem, please try the following method:
Use identity impersonation in web.config, in < system.web > Section to join < identity impersonate="true" userName=" your username "password=" password "/ >
< /system.web >

< identity impersonate="true" userName=" your username "password=" password "/ >
The super user I tested here -- passed

Related articles: