Tag Archives: COM

Office com reports an error. It seems that Microsoft’s test is no more than soso

Using c# to write a program to operate word, the machine test is no problem. Get a virtual machine and conduct compatibility test in the XP below. It is found that this error is reported:

InvalidCastException: Unable to cast COM object of type ‘Microsoft.Office.Interop.Word.ApplicationClass’ to interface type ‘Microsoft.Office.Interop.Word._Application ‘. This operation failed because the queryinterface call on the COM component for the interface with IID’ {00020970-0000-0000-c000- 000000000046} ‘failed due to the following error:

Finally, it was found that the initial installation was the simplified version of office 2007 that came with ghost. There were residues when uninstalling 2007, which interfered with office 2003. Find the 00020970-0000-0000-c000- 000000000046 primary key. The following typelib item is {00020905-0000-0000-c000- 000000000046}. Then find the {00020905-0000-0000-c000- 000000000046} primary key. The following two items are 8.3 and 8.4. 8.3 is office 2003 and 8.4 is office 2007. Delete branch 8.4. The program runs normally

It has always been thought that Microsoft’s commercial software has the best compatibility. Now it seems that Microsoft’s compatibility test is just like this. Office, a heavyweight software, also has the problem of unclean version uninstallation

Transferred from: http://www.cozyboy.com/archives/79.html

The component with CLSID {000209ff-0000-0000-c000-000000000046} in the com class factory failed due to the following error: 80070005 access denied. The latest solutions

Failed to retrieve component with CLSID {000209ff-0000-0000-c000-000000000046} in com class factory due to the following error: 80070005 access denied( Exception from HResult: 0x80070005 (E)_ ACCESSDENIED))。

The solutions to this problem on the Internet are as follows:

1. Click Win + R and enter comexp.msc – 32 (if the word of the button is 64 bit, enter dcomcnfg)

2. Find the DCOM configuration of “component service –” computer “–” my computer “–“

3. Find the right-click property of “Microsoft Word 97-2003 document”

4. Select “interactive user” in the “identity” column

5. In the “security” column, you can see the “startup and activation” group, select “custom”, click “Edit” button, add network service and current user, and give “local startup” and “local activation” permissions

6. “Access rights” and “configuration rights” are the same as above

7. In & lt; system.web>& lt;/ system.web> Add & lt; Identityimpersonate = “true” user name = “current user name” password = “XXXXXX”/& gt

—————————————————

Causes of errors

Due to the previous installation of office 2016 professional enhanced version expired, reported the “user name and password error exception”, so on the Internet to find the key to crack, very difficult to crack, the result is this problem

Failed to retrieve component with CLSID {000209ff-0000-0000-c000-000000000046} in com class factory due to the following error: 80070005 access denied( Exception from HResult: 0x80070005 (E)_ ACCESSDENIED))。

On the Internet to find the above method, but it is not useful! I couldn’t find the solution. I also tried to modify the registry (found CLSID: 00020906-0000-0000-c000-000000000046word 97 document), which was different from the error 000209ff-0000-0000-c000-000000000046. I wanted to modify it and got tangled. Later, I read a forum and saw the following solution by accident; So the eyes into the server IIS body

Just modify the application pool of IIS, select your project, click Advanced settings, and change the ID to: localsystem or networkserver

Original text: https://blog.csdn.net/qq_ 18979049/article/details/79410331