469,944 Members | 2,305 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Excel hangs while trying to open a workbook in ASP


I'm writing an ASP application to open an excel workbook, then run a
macro stored in the excel file, which produces outputs that will be
displayed back onto my ASP application.

Now the problem I'm having is whenever I try to open a workbook (of
any format, i.e. 97/2000, 95, or xp, and of any size, and with or
without macros), excel just hangs forever, and if I killed the excel
application in task manager, my asp application will resume to run the
rest of the code.

I've given the internet guest user full rights along the entire path
for the excel file (the path for the excel file is

My computer configurations are: WinXP Pro with Service Pack 1, Excel
2000, and IIS 5.1

One interesting thing to note is if I put a macro in my excel file
under Workbook_Open, doing only Application.Quit, excel doesn't hang
(i.e. my asp application runs to completion), which means that excel
probably opened my excel file, but it's either waiting for a prompt or
just stuck inside the excel application itself. I have made the excel
application visible and display alert, yet, I don't see any messages
popping up from excel.

Here is the code I'm using to open excel in my asp pages:

set ExcelApp = Server.CreateObject("Excel.Application")
'despite these 2 lines, I still don't see any messages
ExcelApp.Visible = true
ExcelApp.DisplayAlerts = true
ExcelApp.Workbooks.Open(Server.MapPath(filename)) --- it hangs here
'I've tried hardcoding the path, but still doesn't solve the problem,
also if
'I put in some false path (i.e. non existent excel file), it doesn't
'I suppose this is expected because there's nothing to open, so excel
'this is my macro in excel
graphHtml = ExcelApp.run(filename + "!produce_output", design_type,
'to kill the application
set ExcelApp = nothing

One last thing I should mention is, prior to this chunk of code, I
used an ADO connection to connect to the same excel file to do some
data updating (the reason for this is I find using ADO is faster and
more convenient, and partly because excel wasn't opening properly with
the excel object model), but I close it and set it to nothing before I
move onto this section of the program, don't know if it's affecting
anything though.

Jul 19 '05 #1
1 6035
"Lize" <li****@yahoo.com> wrote in message
news:1a**************************@posting.google.c om...

I'm writing an ASP application to open an excel workbook, then run a

Please don't multi-post. Answered in .iis ...

Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Konstantin Loguinov | last post: by
reply views Thread by acharyaks | last post: by
6 posts views Thread by Matthew Wieder | last post: by
1 post views Thread by yosh o | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.