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

Excel hangs while trying to open a workbook in ASP

P: n/a
Hi,

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
C:\Inetpub\wwwroot\test\test.xls).

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
hang
'I suppose this is expected because there's nothing to open, so excel
doesn't
'hang
ExcelApp.calculate
ExcelApp.save
'this is my macro in excel
graphHtml = ExcelApp.run(filename + "!produce_output", design_type,
test_type)
'to kill the application
ExcelApp.Quit
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.

Thanks
Susan
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Lize" <li****@yahoo.com> wrote in message
news:1a**************************@posting.google.c om...
Hi,

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.microsoft.com/windowsserv...y/centers/iis/
http://mvp.support.microsoft.com/
http://www.iisfaq.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://www.tryiis.com
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.