System.UnauthorizedAccessException

G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top