The COM method is very troublesome and unstable. I haven't solved the problem for a long time .. In the. NET and JAVA environments, you can consider using the NPOI component to implement OFFICE operations. This component is open-source and has very powerful functions. I am currently using this component. Hope to help you.
Retrieving components whose CLSID is {00024500-0000-0000-C000-000000000046} in the COM class factory failed because of the following error: 80070005 Access denied. (The exception is from HRESULT: 0x80070005 (E_ACCESSDENIED )).
Configure DCOM
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 "network service" user (note that you must select the computer name) and grant it the "local start" 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 "network service" user and grant "local access" permission.
Note: you must add the above permissions of the "add machine name/ASPNET" user to the XP system.
In window 2003 server, if the 8000401a error still persists, select "The following user" in the mark and enter the user who logs on to the computer and has local Excel operation permissions. Or select "Enable User" in the label"