By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,969 Members | 1,735 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,969 IT Pros & Developers. It's quick & easy.

Security problem w/ VB.Net and Word/Excel on Vista 32bit

P: n/a
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

Oct 17 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"John Heitmuller." <jo*************@jrfcorp.netwrote in message
news:11**********************@z24g2000prh.googlegr oups.com...
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?
It's called setting up a Vista UAC Manifest that an application/program will
use to present the proper credential such as Run As Administrator to Vista
so that Vista will allow the program to run with the proper credentials
needed.

Look it up and find out how to create a .Net solution that uses the Vista
UAC Manifest -- use Google.

Oct 18 '07 #2

P: n/a
Thanks.

Oct 18 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.