Can I get some help here! Posted 10/4/04 - no reply there

G

Guest

1st post 10/4/2004. Any advice is appreciated.

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.
 
G

Guest

You say if you use impersonation, you get the file not found message.

Question - is the file in question on the C: drive on YOUR machine, or on
the web server?

If the file you want is on the C: drive of your machine but the web server
is a different machine, the web server is going to look on ITS C Drive, not
yours.
 
G

Guest

File is in proper place - actual location is H:\username\<filename>.xls.
My web app creates the file correctly and it's located here. I can't open
this from the server - I believe it's security issue - since file is there /
and possible error message from server is incorrect. NOTE: If I do this off
a local machine with IIS server - I have no problems too.

ALSO, NOTE: I do same thing with .PDF format of file - and I have no problem
downloading file then opening using Adobe Reader - from server & local
machine.

Problem appears to be issue with .XLS file is it won't open properly from
server. I think the "file not found" is misleading - it's more of a security
issue when doing this with Excel - and I'm @ a roadblock.
 
G

Guest

Yes. I can open excel documents simply by double-clicking on document. I
believe the default Excel on Server is Excel 97 (also have Excel 2000)
installed. And I've used the correct Com object for Excel 97 too.

So again - I'm somewhat @ a roadblock. All advice is greatly appreciated -
or other options to explore are helpful.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top