Access Is Denied

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have searched the archives and found several entries that address the problem I'm having, however, the solutions fall short of explaining exactly what to do

Like many others, when I attempt to access an Excel file via an ASP.NET page, I get an access is denied error on the line "dim XSL as new Excel.application"

some solutions tell me to change my authentication in web.config file - I don't know what to chang
some solutions tell me to enter component services and change the default security settings on my dcom - which dcom, there's only about 50 of the things. I did the obvious, changed it on the excel application - didn't work

these solutions addressed this application and a given file. this is being developed on a development machine with IIS installed and running as the test platform. assuming I get it to work here, what changes on the IIS network server and the file server when I move the file and the apps

if anyone would be gracious enuf to take the time and give the step by step instructions as to what to change and where, I would be most appreciative. sorry for the sarcastic overtones, its been a long day

Thanx
Ed.
 
See comment inilne.

Ed said:
I have searched the archives and found several entries that address the
problem I'm having, however, the solutions fall short of explaining exactly
what to do.
Like many others, when I attempt to access an Excel file via an ASP.NET
page, I get an access is denied error on the line "dim XSL as new
Excel.application".

The user account used for the web application (by default, it is ASPNET)
usually does not have permission to run programs on the server outside the
web app, unless you/server administrator authorize the web app user account
to do so.
some solutions tell me to change my authentication in web.config file - I
don't know what to change

Authentication does not make things different regarding permission,
authorization does. They are different things. You need to give the user
account of your web app (ASPNET, or other if you impersonate the account),
permisstion t execute "EXCEL.EXE" (located in C:\Program files\Microsoft
Office\Office[office10][office11]).

Theoretically, you can run office desktop apps on web server, but it is
usually a bad design. Apps in office are never designed to run in an
unattended web server, especially if the server is open to the Internet. You
may be able to run it fine in a small network, like your office LAN, with
little chances of many users accessing Excel on the server concurrently, on
a publicly accessible web server, with unkonown concurrent users' access,
you may end up with so many Excel apps launched and not responding due to
unexpected warning messagebox. Who is going to the server physically dismiss
that?


some solutions tell me to enter component services and change the default
security settings on my dcom - which dcom, there's only about 50 of the
things. I did the obvious, changed it on the excel application - didn't
work.
these solutions addressed this application and a given file. this is being
developed on a development machine with IIS installed and running as the
test platform. assuming I get it to work here, what changes on the IIS
network server and the file server when I move the file and the apps?
if anyone would be gracious enuf to take the time and give the step by
step instructions as to what to change and where, I would be most
appreciative. sorry for the sarcastic overtones, its been a long day.
 
If your purpose is to read (or event update) data in *.xls file, you do not
have to open it in Excel on the web server. Yo can use OleDb namespce to
handle data in *.xls file as a database. This way you can simply put the
*.xls file in your web app's directory/subdirectory, so the web app user
account can access it without extra permission problem. To use OleDb to
access data in *.xls file, someone just asked a similar question and William
Ryan gave a good reply, here I copy the reply here for your convenience
(follow the link Ryan gives):


William Ryan wrote:


If you need to manipulate the data once you open it and do anything with the
worksheets, than you are probably going to have to use COM. However, if you
just need to open it up and read in data and possibly write it back, then
check this out.. http://www.knowdotnet.com/articles/exceldatasource.html

João Santa Bárbara said:
Hi all
i need to open a Excel File Without using the com Objects, how can i do this
???

i have see that msoffice 2003 install in the windows\Assmbly Directory an
assembly, but i tried to browse it via reference, but dotnet 2003 doens´t
accept ? how can i solve this ???

thsk
JSB



Ed said:
Thanx for the information and tip, however, when I gave permissions to
execute to ASPNET and then reran the form, I got the same error - Access
denied. I understand that using Excel in a web app is a bad idea, however,
we have users here that put a lot of data into an Excel spreadsheet(s -
100s) and now need to get those data to the DB. In my attempt to learn
ASP.NET I thought it would be a good exercise to move this data using
ASP.NET. I'm not under any time constraint (yet) and I would be the only one
using the app - so, what the hell - give it a try.
In so far as the access denied error, I have no idea what to do next - can
find any documentation (on-line books) about it.
 
Back
Top