Click here to Skip to main content
15,885,111 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi All,

Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.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

I am getting this exception at:

((Word._Application)WordApp).Quit();

please give me any suggestion to resolve it..

Thank you..
Posted
Comments
Richard MacCutchan 19-Apr-13 11:45am    
You should not be casting to _Application as it is not the same type as your application object.

Hi,

Check this link: http://support.microsoft.com/kb/315981/en-us[^]

CType(WordApp, Word._Application).Quit()


Good luck.
JAFC
 
Share this answer
 
Don't know if it will help, but check this post reporting a similar problem:
http://stackoverflow.com/questions/12957595/error-accessing-com-components[^]

Regards.
 
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