471,852 Members | 927 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,852 software developers and data experts.

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

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
2 5839

"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
Thanks.

Oct 18 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by =?Utf-8?B?TW9vZHlCbHVl?= | last post: by
7 posts views Thread by Nicolas Hinze | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.