470,596 Members | 1,473 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,596 developers. It's quick & easy.

Launching Excel from ASP.NET application

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.

Nov 19 '05 #1
1 1659
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. <snip> 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...;EN-US;q257757

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

http://officewriter.softartisans.com

Best,
Chris

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Matthew Wieder | last post: by
4 posts views Thread by Staticbob | last post: by
1 post views Thread by John A. Bailo | last post: by
1 post views Thread by =?Utf-8?B?TWFyayBIb2xsYW5kZXI=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.