Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - System.UnauthorizedAccessException

 
Thread Tools Search this Thread
Old 10-04-2004, 05:39 PM   #1
Default System.UnauthorizedAccessException


Attempt to open Excel file using ASP.NET. Sample snipet of source code is as
follows:
Dim _RptDocument As Object, _RptFormat As Object
Dim _RptFile As String = "C\Downloads\<any file name>.xls"

_RptFormat = New Excel.Application()
_RptDocument = _RptFormat.WorkBooks
_RptDocument.Open( _RptFile )
_RptFormat.Visible = True

When I use impersonation in ASP.NET application - web.config file...
<identity impersonate="true"/>
I have no problem opening this on my local machine. When I use the network
- I continually get access denied.

If I use a username tag as follows:
<identify impersonate="true" username = "Domain\username"
password="password/> - NOTE: I also set the security settings for
"R/W/Modify" for the folder too!
I get the following run-time error...
Source: System.Web
Error: Exception of type System.Web.HttpUnhandledException was thrown.

'C:\Downloads\Rpt.xls' could not be found. Check the spelling of the file
name, and verify that the file location is correct.

What do I need to do on the IIS server - or what security settings - what
account could I use to have the instruction "_RptFormat = New
Excel.Application()" work properly - and view the Excel file from the server.



=?Utf-8?B?RGF2aWRT?=
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump