473,396 Members | 2,098 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Excel System.UnauthorizedAccessException

I got the web application to open up the excel. It works fine on my
development box. But when i moved it to the production server, I cannot get
the Excel spreadsheet to open. I get System.UnauthorizedAccessException:
Access is denied.
I've granted full access for the excel file stored in the server, but still
can't access it. Please help!
Jul 21 '05 #1
4 4656
Have you tried granting the ASP user to have read access of the file? By
default this is ASPNET. Make sure you don't have 'deny' permission on that
file as well since it has higher precedence than the 'allow' permission.

--
Victor Hadianto
http://synop.com/Products/SauceReader/

"Jane" <Ja**@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
I got the web application to open up the excel. It works fine on my
development box. But when i moved it to the production server, I cannot
get
the Excel spreadsheet to open. I get System.UnauthorizedAccessException:
Access is denied.
I've granted full access for the excel file stored in the server, but
still
can't access it. Please help!

Jul 21 '05 #2
Jane,

Is it opening the file on the clientside or the serverside?

Cor

"Jane" <Ja**@discussions.microsoft.com>
..
I got the web application to open up the excel. It works fine on my
development box. But when i moved it to the production server, I cannot
get
the Excel spreadsheet to open. I get System.UnauthorizedAccessException:
Access is denied.
I've granted full access for the excel file stored in the server, but
still
can't access it. Please help!

Jul 21 '05 #3
I have granted permission....
I'd like the excel to open on the client side, but seems like is not doing
it....

here's my code:

Excel.ApplicationClass excelObj = new Excel.ApplicationClass();
excelObj.Visible=true;
Excel.Workbook newbook =
excelObj.Workbooks.Add(Excel.XlWBATemplate.xlWBATW orksheet);
Excel.Workbook workBook =
excelObj.Workbooks.Open(strFileName,0,true,5,"","" ,true,Excel.XlPlatform.xlWindows,"",false,false,0, true,true,false);
Excel.Sheets sheets = workBook.Worksheets;
Excel.Worksheet dataSheet = (Excel.Worksheet)sheets.get_Item("Trade Ticket
Lookup");
Excel.Range range = dataSheet.get_Range("B2",Type.Missing);
dataSheet.Select(Type.Missing);
range.Cells.Value2=tradeID;

Excel.Worksheet tradesRealSheet = (Excel.Worksheet)sheets.get_Item("Trades
(Real)");
tradesRealSheet.Select(Type.Missing);

excelObj.Application.Quit();

I don't know what I'm doing wrong here, please help!
Thanks!

"Cor Ligthert" wrote:
Jane,

Is it opening the file on the clientside or the serverside?

Cor

"Jane" <Ja**@discussions.microsoft.com>
..
I got the web application to open up the excel. It works fine on my
development box. But when i moved it to the production server, I cannot
get
the Excel spreadsheet to open. I get System.UnauthorizedAccessException:
Access is denied.
I've granted full access for the excel file stored in the server, but
still
can't access it. Please help!


Jul 21 '05 #4
Jane,

I saw that did not read it well, sorry, however maybe can this link help
you?

http://support.microsoft.com/default...;EN-US;Q257757

Cor
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sk | last post by:
Please forgive me if the same topic is already posted. But i havent found I have got an error while accessing the excel file as below. Can somebody reply if there is a solution Access is denied....
1
by: Steve | last post by:
I am trying many ways to create and save data to an Excel file, but all I got is the following error message. (The code behind is in C#.net) System.UnauthorizedAccessException Here is my...
3
by: hari krishna | last post by:
hi, I am generating excel reports through vb.Net. After creating excel.application and the report is generated, each report leaves Excel in memory. I can see them in task manager in Process tab...
9
by: hari krishna | last post by:
hi, I want to send the data from dataset information to Excel through ASP.Net. there will be no XL installed on web server. web server is win 2000 server machine. I am using visual basic code in...
3
by: Michael Tkachev | last post by:
Hello, I need to create an "Excel" file in the ASP.net. But a security system doesn't allow to do it. What can I do? There is an exception heppens when I try to execute the following row: ...
8
by: jack | last post by:
Access is denied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it...
3
by: DS | last post by:
I try to generate a excel workbook using Excel object in ASP.NET program. When I implement the Excel workbook generation with out a thread it works fine. When I wrap all the excel generation...
4
by: Jane | last post by:
I got the web application to open up the excel. It works fine on my development box. But when i moved it to the production server, I cannot get the Excel spreadsheet to open. I get...
2
by: kelvinweb | last post by:
Hi All, I don't why alert below error message when I am using "Excel Application". I have to following the instruction, but the error is still here. Please help .. Dim excelApp As New...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.