The specific configuration method is as follows:
1: Install the Excel software for office on the server.
2: Enter to start "Component Service" in "Start"->"Run"
3: Double-click "Component Services"->"Computer"->"My Computer"->"DCOM Configuration"
4: Find "Microsoft Excel Application" in "DCOM Configuration", right-click it, and then click "Properties", and the "Microsoft Excel Application Properties" dialog box pops up
5: Click the "Identification" tab and select "Interactive User"
6: Click the "Security" tab, click "Customize" on "Start and Activate Permissions", then click the corresponding "Edit" button, and add a "NETWORKSERVICE" user in the pop-up "Security" dialog box (note that you need to select this computer
and give it "local startup" and "local activation" permissions.
7: Still the "Security" tag, click "Customize" on "Access Rights", then click "Edit", and add a "NETWORKSERVICE" user to the pop-up "Security" dialog box, and then give "Local Access" permission.
In this way, we configure the corresponding Excel DCOM permissions.
Note: I configured it on WIN2003, and on 2000, I configured ASPNET users
If you do not configure it, an error will occur
Retrieving a component with CLSID {00024500-0000-0000-C000-0000000000046} in the COM class factory failed because of the following error: 80070005.
The reason is that the user does not have permission to use Excel.
To export to word, you also need to configure permissions to use word.
Failed because of the following error: 80070005
symptom:
oWordApplic = New
When the program runs to this sentence, the following error occurs:
Retrieving a component with CLSID {000209FF-0000-0000-C000-00000000046} in the COM class factory failed because of the following error: 80070005.
oWordApplic = New
When the program runs to this sentence, the following error occurs:
Retrieving a component with CLSID {000209FF-0000-0000-C000-00000000046} in the COM class factory failed because of the following error: 80070005.
Solution 1:
Control Panel -> Management Tools -> Component Services -> Computer -> My Computer -> DCom Configuration -> Find Microsoft Word Documents
after
Click Properties to open the Properties dialog box for this application.
2. Click the Identification tab and select Interactive User.
3. Click the "Security" tab, select "Custom" in the "Start and Activate Permissions" and "Access Permissions" groups respectively, and then
Custom -> Edit -> Add Account and IUSER_Computer Name
* These accounts only exist if IIS is installed on the computer.
13. Make sure each user is allowed to access and click OK.
14. Click OK to close 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 the <identity impersonate="true" userName="your username"password="password"/> in the <> section
</>
<identity impersonate="true" userName="your username"password="password"/>
Here I used super user test--pass
1: Install the Excel software for office on the server.
2: Enter to start "Component Service" in "Start"->"Run"
3: Double-click "Component Services"->"Computer"->"My Computer"->"DCOM Configuration"
4: Find "Microsoft Excel Application" in "DCOM Configuration", right-click it, and then click "Properties", and the "Microsoft Excel Application Properties" dialog box pops up
5: Click the "Identification" tab and select "Interactive User"
6: Click the "Security" tab, click "Customize" on "Start and Activate Permissions", then click the corresponding "Edit" button, and add a "NETWORKSERVICE" user in the pop-up "Security" dialog box (note that you need to select this computer
and give it "local startup" and "local activation" permissions.
7: Still the "Security" tag, click "Customize" on "Access Rights", then click "Edit", and add a "NETWORKSERVICE" user to the pop-up "Security" dialog box, and then give "Local Access" permission.
In this way, we configure the corresponding Excel DCOM permissions.
Note: I configured it on WIN2003, and on 2000, I configured ASPNET users
If you do not configure it, an error will occur
Retrieving a component with CLSID {00024500-0000-0000-C000-0000000000046} in the COM class factory failed because of the following error: 80070005.
The reason is that the user does not have permission to use Excel.
To export to word, you also need to configure permissions to use word.
Failed because of the following error: 80070005
symptom:
oWordApplic = New
When the program runs to this sentence, the following error occurs:
Retrieving a component with CLSID {000209FF-0000-0000-C000-00000000046} in the COM class factory failed because of the following error: 80070005.
oWordApplic = New
When the program runs to this sentence, the following error occurs:
Retrieving a component with CLSID {000209FF-0000-0000-C000-00000000046} in the COM class factory failed because of the following error: 80070005.
Solution 1:
Control Panel -> Management Tools -> Component Services -> Computer -> My Computer -> DCom Configuration -> Find Microsoft Word Documents
after
Click Properties to open the Properties dialog box for this application.
2. Click the Identification tab and select Interactive User.
3. Click the "Security" tab, select "Custom" in the "Start and Activate Permissions" and "Access Permissions" groups respectively, and then
Custom -> Edit -> Add Account and IUSER_Computer Name
* These accounts only exist if IIS is installed on the computer.
13. Make sure each user is allowed to access and click OK.
14. Click OK to close 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 the <identity impersonate="true" userName="your username"password="password"/> in the <> section
</>
<identity impersonate="true" userName="your username"password="password"/>
Here I used super user test--pass