Click here to Skip to main content
11,411,241 members (65,783 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
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 3-Dec-12 2:57am
Comments
Richard MacCutchan at 19-Apr-13 11:45am
   
You should not be casting to _Application as it is not the same type as your application object.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi,

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

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

Good luck.
JAFC
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 189
1 Maciej Los 108
2 OriginalGriff 88
3 Sascha Lefévre 85
4 BillWoodruff 80
0 Sergey Alexandrovich Kryukov 8,920
1 OriginalGriff 6,918
2 Maciej Los 3,390
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web01 | 2.8.150414.5 | Last Updated 19 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100