472,362 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,362 software developers and data experts.

Excel hangs while trying to open a workbook in ASP

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
1 6252
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Konstantin Loguinov | last post by:
Guys, I have been killing myself over this one for a while and can't find what is wrong. Here is the problem... I have an ASP application that claculates certain values. It used to be in...
11
by: Mr. Smith | last post by:
Hello all, My code can successfully open, write to, format and save several worksheets in a workbook then save it by a given name, close and quit excel. My problem is that if I try and do it...
8
by: mytfein | last post by:
Hi Everyone, Background: Another department intends to ftp a .txt file from the mainframe, for me to process. The objective is to write a vb script that would be scheduled to run daily to...
0
by: acharyaks | last post by:
Hi life saver, I am using excel component for the development. The purpose is to connect to excel through the odbc connection string. Then through the connection extract data into a dataset and...
6
by: Matthew Wieder | last post by:
I have the following requirements: Build a stand-alone C# application that asks the user to click in a cell in an Excel spreadsheet, and then displays the address of that cell in the C#...
1
by: yosh o | last post by:
I hope this is the right area to post this, and I appoligize if it isn't in advance. I've spent the last few days trying to figure out what I'm doing wrong in this code. What I'm doing is that...
16
by: LP | last post by:
Hello, I am trying to use .NET with Excel. I installed Office 2003 and selected ..NET programming suport option, so it installed all those PIA, as MS sugests. But I can not find a way to destroy...
2
by: sgr | last post by:
Hello I'm making an application that uses an excel worksheet, My problem appears when I open the worksheet to see the data (then I close it and save the changes) and I try to insert a new row from...
0
by: guptasourav | last post by:
I am opening an Excel file on my server, and saving it with some other name and then trying to coping the new excel to my local machine. If i use a simple Excel(without macro but with password) it...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
0
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.