By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,453 Members | 1,437 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,453 IT Pros & Developers. It's quick & easy.

Excel hangs while trying to open a workbook in ASP

P: n/a

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 = + "!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
Share this Question
Share on Google+
1 Reply

P: n/a
"Lize" <li****> wrote in message
news:1a************************** 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 - tools, scripts, and utilities for running IIS
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.