Click here to Skip to main content
15,887,585 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Im using VS 2005 and MS office 2003
C#
_Document oWordDoc = oWordApp.Documents.Open(ref fileName,
                                    ref missing, ref readOnly,
                                    ref missing, ref missing, ref missing,
                                    ref missing, ref missing, ref missing,
                                    ref missing, ref missing, ref isVisible,
                                    ref missing, ref missing, ref missing, ref missing);

Need urgent help to sort out
At this I'm getting error as :
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: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Posted
Updated 1-May-19 3:20am
v2

1 solution

Check this thread & keep looking there till the solution

C# Word Automation Exception[^]

But based on the partial error message(No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).) I got guesses(by the below threads), you need to repair the MS Office or need to re-register the appropriate dll. Check this for detailed explanation(Actually the below threads are not about MS office but similar type[based on error message]) so give it a try or wait for the answer in above MSDN link

Problem has been solved out.

Actually, the server OS was of older version. So I uploaded the older version of ADODB.dll in bin folder and the problem got solved.

===== Solution =====

After a bit of investigation, I found that the registry is somehow corrupted, and the solution is to re-register DLL.

~ Run [ Command Prompt ] (You will need to use the **Run as administrator** option)
Also check these threads

...... No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).[^]
"Oops!" error when creating documents[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900