Microsoft IIS
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsSystem AdministrationMicrosoft IIS

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 17th, 2004, 04:52 PM
neoacid neoacid is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 19 neoacid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Excel Macro Hangs in ASP

I have a problem that i have been unable to resolve for some time now. I have tried searching on google and MSDN for
a specific solution, but haven't found any. Essentially, I'm trying to get VBScript code in a web page to open an Excel workbook
on the server and run a macro from the workbook on the server. I was able to make this work when I was using IIS 4.0
and Office 97; however, it still behaved strangely at times and would hang whenever an error occurred in the macro.

Recently, i migrated my server to Windows 2000 Server with IIS 5.0 and Office 2000. Now, when i view the scripted web page,
it will not open any workbooks that contain macros without causing Excel to hang. When i go to task manager to try
to end the Excel process, it says "Access Denied" and will not allow me to terminate it, so i have to reboot every time it hangs.

I have set the macro security on the server to low so that it doesn't bring up the macro alert message.
I have also set the permissions in IIS to allow for scripting and executing files.
The macro code is not to blame for sure, because I don't even call the macro and I get the same problem with an
empty macro module in the workbook. However, if i remove the module from the workbook, the script will execute
just fine without causing Excel to hang.

I have also tried running the same code from a *.vbs file locally on the server,
and it runs correctly. But again, when I try to run the *.vbs file from the web page using the Windows Scripting Host Object
to make the call, it causes wscript.exe to hang and I cannot terminate it. I would rather have the code inside of the asp
web page because i have to do this with several workbooks.

Here is an example of the code in my web page:

dim ExcelApp, ExcelWB, cellcount
set ExcelApp = Server.createobject("Excel.Application")
ExcelApp.visible = true
set ExcelWB = ExcelApp.Workbooks.Open("C:\inetpub\wwwroot\Asp Test SpreadSheet.xls")
cellcount = ExcelWB.Sheets(1).UsedRange.Cells.Count
ExcelWB.Close
ExcelApp.Quit
set ExcelWB = nothing
set ExcelApp = nothing


If "Asp Test SpreadSheet.xls" has an empty macro module in it, it will cause Excel to hang on the server. Task Manager
gives a message "Access Denied" when i try to terminate it. Without any modules, the script works.

Are there any other settings in IIS that I should change or is there something I have to enable before I can get this
to work? Does this problem sound like it is IIS-related or ASP-related?

Reply With Quote
  #2  
Old February 17th, 2004, 08:55 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 21 h 28 m 48 sec
Reputation Power: 180
You will have better luck getting an answer if you only post your question once, in one forum.

I for one will often not answer a crossposted question.
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old February 18th, 2004, 02:28 PM
neoacid neoacid is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 19 neoacid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sorry about that. I really don't know where this question fits as my understanding of IIS, ASP,
and VBscript and how they cooperate is fairly poor. I am really desperate for some help and was unsure
if someone would reply to my question if i posted to the wrong forum. Sorry.

Reply With Quote
  #4  
Old February 18th, 2004, 05:52 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 21 h 28 m 48 sec
Reputation Power: 180
Well, I suspect it's a permissions-related issue. I have never tried to open Excel on a web server, in fact I have no servers with Office installed.

Reply With Quote
Reply

Viewing: ASP Free ForumsSystem AdministrationMicrosoft IIS > Excel Macro Hangs in ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway