Wrox Programmer Forums
|
BOOK: Professional C#, 2nd and 3rd Editions
This is the forum to discuss the Wrox book Professional C#, 3rd Edition by Simon Robinson, Christian Nagel, Karli Watson, Jay Glynn, Morgan Skinner, Bill Evjen; ISBN: 9780764557590
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C#, 2nd and 3rd Editions section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 25th, 2005, 10:53 AM
Registered User
 
Join Date: Nov 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default WebPart Permission Problem

I'm currently developing a WebPart reading (and later hopefully writing) an Excel file (using Microsoft.Office.Interop.Excel). When testing I get the following error message:

Quote:
quote:System.Security.SecurityException: Request for the permission of type System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
This is basically the code I'm running and the error occurs when executing the last command:

Code:
path = "C:\\Test.xls";
workbook = app.Workbooks.Open(path,Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
sheet = (Worksheet)workbook.ActiveSheet;
excelCell = (Range) sheet.get_Range("B2", "B2");
String test =  excelCell.Value2;
I'm just wondering why the "Excel-operations" are executed without producing an error except the last one.

Any ideas???






Similar Threads
Thread Thread Starter Forum Replies Last Post
WebPart \ Default display problem rparchment BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 10 February 7th, 2007 12:47 AM
Problem with webPart rrsparihar ASP.NET 2.0 Basics 1 October 5th, 2006 07:21 AM
Problem with WebPart rrsparihar Visual Studio 2005 0 October 3rd, 2006 09:41 AM
(0x800A0046) Permission denied,not IIS permission! David Hay Classic ASP Basics 3 April 30th, 2006 10:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.