Some time ago, when I made a document statistics page in the company, I needed to make a statistics on the number of pages in the word file. However, after the program is written, an error is always reported.
An error occurred while retrieving components whose CLSID is {00021a20-0000-0000-c000-0000000000000046} in the COM class factory because of the following error: 80080005
After trying for a long time, I finally found out that the problem lies in the permission of the com component.
1: Install wordsoftware 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 Word 97-2003 Document", right-click it, and then click "properties". The "Microsoft word 97-2003 document attributes" 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 an 8000401a error occurs, select "The following user" in the mark and enter the user who logs on to the computer and has the permission to operate locally on the word. or select "Enable User"
The above method was provided by netizens, but later it was still unavailable. The final key was to directly use the administrator in the mark, enter the Administrator account and password, and finally the success was achieved.