Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Excel Interop ActiveXSEcurity exception

[VB.NET 2003 XP Pro SP2 .NET FrameWork 1.1]
I am using the MS Office PIA to create an Excel Microsoft Office System
Project.
I have added a menu button to the Excel spreadsheet. When clicked this
displays a form that contains a COM ActiveX control (ComponentOne Query8)

When I instantiate my form (from the OfficeCodeBehind class) which has
C1QueryFrame controls & a C1Query control on it I get a
System.Security.SecurityException exception generated with the message
"Request Failed"

ie Dim myForm as new MyQueryForm generates the exception

Are there any known issues with using ActiveX/COM controls from an Excel
..NET project?

It is fine when used from a normal windows application.

The only way around this that I have found so far is to turn off .NET
Security using:
caspol -s off

My .NET framework configuration assigns full control to all assemblies on
MyComputer, which where all this is running.
TIA,
Graeme Hart

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Excel Interop ActiveXSEcurity exception

I have found the solution. It is desribed in this article:
http://msdn.microsoft.com/msdnmag/is...3/default.aspx

It is all down to the .NET Framework security policy for the user and the MS
Office Excel .NET Project.
I changed the Trust Level on MyApp_Bin from Execute to FullTrust and now my
form appears OK.

Graeme

"Graeme" wrote:

[VB.NET 2003 XP Pro SP2 .NET FrameWork 1.1]
I am using the MS Office PIA to create an Excel Microsoft Office System
Project.
I have added a menu button to the Excel spreadsheet. When clicked this
displays a form that contains a COM ActiveX control (ComponentOne Query8)

When I instantiate my form (from the OfficeCodeBehind class) which has
C1QueryFrame controls & a C1Query control on it I get a
System.Security.SecurityException exception generated with the message
"Request Failed"

ie Dim myForm as new MyQueryForm generates the exception

Are there any known issues with using ActiveX/COM controls from an Excel
.NET project?

It is fine when used from a normal windows application.

The only way around this that I have found so far is to turn off .NET
Security using:
caspol -s off

My .NET framework configuration assigns full control to all assemblies on
MyComputer, which where all this is running.
TIA,
Graeme Hart

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Immediate Fail: Launch Excel via Interop Doug Price Excel Discussion (Misc queries) 0 January 22nd 10 04:34 PM
Microsoft.Office.Interop.Excel when exporting from another program Colin Excel Discussion (Misc queries) 0 January 2nd 09 06:08 AM
Activex control security message John Morgan[_3_] Excel Programming 0 September 23rd 04 10:37 AM
Displaying multiline Text into Excel Cell through Interop Karthikeyan Excel Programming 5 July 5th 04 04:23 PM
Excel Workbook opened twice with dotnet interop Steve Weixel Excel Programming 0 August 25th 03 11:37 PM


All times are GMT +1. The time now is 12:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"