Hi, I have a VB.Net application that I have recently upgraded from
Visual Studio 2003 to Visual Studio 2005. The VB.Net app accesses
Word and Excel. When I run the newly compiled VB.Net app on the
Windows XP Pro system the app can interact with Word and Excel just
fine. I'm pretty certain I have the correct Microsoft Word 11.0
Object Library and Microsoft Excel 11.0 Object Library references.
All of my library references have Local Copy set to true.
When I run the app on a Vista 32bit system I get the following error.
Source: Microsoft.Office.Interop.Word
System.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: could not be found. (Exception from HRESULT:
0x80030002 (STG_E_FILENOTFOUND))."} System.InvalidCastException
Now for the odd part. On the Vista system when I right-click on the
new app .exe and select 'Run as administrator' the app runs without
error and can interact with Word and Excel with no problem. When I
just run the app as myself (I am a member of the local administrators
group) I get the exception.
This seems like some sort of conflict with new security in Vista.
Anybody got any ideas?
Thanks,
John