473,721 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\wwwr oot\test\test.x ls).

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.Qui t, 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.CreateOb ject("Excel.App lication")
'despite these 2 lines, I still don't see any messages
ExcelApp.Visibl e = true
ExcelApp.Displa yAlerts = true
ExcelApp.Workbo oks.Open(Server .MapPath(filena me)) --- 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.calcul ate
ExcelApp.save
'this is my macro in excel
graphHtml = ExcelApp.run(fi lename + "!produce_outpu t", 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 6386
"Lize" <li****@yahoo.c om> wrote in message
news:1a******** *************** ***@posting.goo gle.com...
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
542
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 Excel and due to complexity of formulas, I couldn't implement Goal Seek function in ASP. To make Goal Seek work, I dump numbers from ASP into Excel, run Goal Seek in Excel and then pick up the results from Excel. This works great on Windows NT 4 and...
11
4053
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 again, Excel hangs. OR if I open Excel again (say from a desktop icon) before I close Access, Excel hangs. (this has happened for both 97 & 2000 for me) I of course thought that I mustn't be unloading a variable properly.
8
3371
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 process this .txt file. Goal: I am working on a vba script to:
0
2821
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 then save the data into a client machine (Intranet) as excel page using the excel component (using Excel = Microsoft.Office.Interop.Excel;) in the code. Please help me. I have wasted so many days on this.
6
12503
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# application. It seems simple enough, but the problem I'm encountering is as follows: In order for the user to select the cell from Excel, they must first click once on the Excel window to give it focus and then their second click is what changes the cell...
1
1319
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 I'm opening an excel file, changing the header and then trying to save and close the file. Instead when I run it, the web page hangs. Sub Headers() Dim xlapp ' Our Excel App
16
4551
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 Excel process, it still hangs in the taks manager' Processes as running. I am trying very simple code (see below), but Excel wont go away, I tried just about anything I could find on MSDN or by Google. Even calling WIN32 API to destroy Excel. But...
2
17360
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 my application appears the error: System.Runtime.InteropServices.COMException(0x800401A8): Exception HRESULT: 0x800401A8 Thanks for all
0
1578
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 works properly but if i use a macro and make the excel password protected then it does not allow me to open it. It does not give any exception but on reaching to "oWB = oXL.Workbooks.Open(" it hangs up. Private Sub Page_Load(ByVal sender As...
0
8840
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8730
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9131
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5981
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4484
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3189
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2130
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.