unable to cast error

C

CMoondancer

Please help I can not get past this issue.



I recieve this error on the example "How to use automation to get and to set
office document properties." http://support.microsoft.com/kb/303296/en-us
this was the recommended fix for this issue.



I can run this same example on my xp machine with office 2003. When I try
this example on my vista machine with office 2003 I get the following error.

System.InvalidCastException was unhandled
Message="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))."
Source="Microsoft.Office.Interop.Word"
StackTrace:
at Microsoft.Office.Interop.Word.ApplicationClass.set_Visible(Boolean
prop)
at WindowsWordtest.Form1.button1_Click(Object sender, EventArgs e) in
C:\Users\Allen\Documents\Visual Studio
2005\Projects\WindowsWordtest\WindowsWordtest\Form1.cs:line 33
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top