|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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.
|
![]() |
| Viewing: ASP Free Forums > System Administration > Microsoft IIS > Excel Macro Hangs in ASP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|