Launching Excel from ASP.NET application

G

Gerry

I have an ASP.NET application installed on a Windows Server 2003
computer. MS Excel is also installed on the same computer. And yes, the
application makes use of Excel.

When the Application Pool Identity for the pool in which this
application resides is set to the default (NetworkService), everything
runs as expected. However, for this application to work, it is
necessary that I use a different user account. And when I do, there is
a problem.

The code that gets executed is this:

Public Sub OpenWorkbook(ByVal FilePath As String)
excelApp = New Excel.Application
excelApp.Visible = True
excelApp.DisplayAlerts = False
excelWorkbook = excelApp.Workbooks.Open(FilePath)
End Sub

When the first line is executed, a new Excel process is created. Thus,
I do not believe that the problem is related to DCOM object
permissions. (Using Component Management, I have granted the App Pool
Identity user launch and configuration permissions for Excel.) However,
when the program tries to open the file, it simply fails to do so,
i.e., it hangs. Note that I do not believe this to be a file permission
issue as this behavior was observed even when the App Pool Identity
account had been added to group administrators. (I also logged into the
server using the App Pool Identity account user and was able to open
and save the file from within Excel.)

Other things tried:
The App Pool Identity account has been added to group IIS_WPG. I have
ensured that this group has Modify permission on the directory into
which the spreadsheet is to be saved. In the Local Policy Editor, I
have added this user to the 'Access this computer from network',
'Log on as batch job', and 'Log on as service' policies. I have
restarted IIS and have rebooted the server. In addition, I believe that
all items listed the MS document 'ASP.NET Required Access Control
Lists) have been addressed.

I am not sure what else to try. Please offer a suggestion.
 
C

Chris Baldwin

I have an ASP.NET application installed on a Windows Server 2003
computer. MS Excel is also installed on the same computer. And yes,
the application makes use of Excel.
I am not sure what else to try. Please offer a suggestion.

Hello Gerry,

Perhaps you've heard this before, but I don't know what else to offer other
than to mention that using Excel on a server is not recommended, even by
Microsoft:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757

There are third-party tools specifically designed for this kind of use:

http://officewriter.softartisans.com

Best,
Chris
 

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,021
Latest member
AkilahJaim

Latest Threads

Top