473,324 Members | 2,254 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,324 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 4645
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.