I'm trying to execute an Excel macro from the VBScript code in an asp page.
The page is served by an IIS installed in a PC with Windows2000, and I'm
accessing that page from another Win2000 PC in the same network environment.
The Excel file is in the same folder as the asp page, and the client has
total permissions in that folder. The code is as follows:
Set ExcelApp = CreateObject("excel.application")
ExcelApp.Visible = False
ExcelApp.DisplayAlerts = False
(*) ExcelApp.Workbooks.Open ("my_workbook.xls")
ExcelApp.Run "my_macro"
ExcelApp.ActiveWorkbook.SaveAs ("my_workbook.xls")
ExcelApp.ActiveWorkbook.Close
ExcelApp.Visible = True
ExcelApp.DisplayAlerts = True
ExcelApp.Quit
Set ExcelApp = Nothing
I have always the same problem in (*) when trying to open the Excel file:
the page keeps on loading "ad infinitum", the IIS hangs up, and an Excel.exe
process stays opened in the server machine locking the workbook, so I have
to restart IIS and kill that process to try it again.
I know the problem is right in the "Open" sentence thanks to some debug
traces: using "Response.Write" before and after that sentence, I saw that
the first three sentences are executed correctly but the next one "crashes".
I thought the problem could be in the permissions in the server machine, so
I shared the Office folder and subfolders in the server to give total
permissions to the user in the client PC and to the IUSR user too, but
nothing changed. Is it necessary to give permissions on the server to any
other user in any other folder? Any other suggestion to solve the problem?
Thanks in advance,
Mikel
2. Could be a mix up with IIS Virtual Directories and the pathname.
Have you tried open with a full filename?
ExcelApp.Workbooks.Open
("c:\inetpub\wwwroot\myHomeDir\my_workbook.xls")
Yes, I already had write access ...
> 2. Could be a mix up with IIS Virtual Directories and the pathname.
> Have you tried open with a full filename?
>
> ExcelApp.Workbooks.Open
> ("c:\inetpub\wwwroot\myHomeDir\my_workbook.xls")
Well, actually, I'm not using virtual names, the VBscript code is trying to
access the file using the full path, exactly like the one you say
(c:\inetpub etc.)
Anyway, thanks for the suggestions.
Open the IIS MMC
Highlight your website
Properties menu
Home Diretory tab
Write checkbox for local path
To help me understand the problem. Excel to to run on the server-side,
right?
You mentioned granting folder permissions on the server to the client.
This is not typical of an ASP application.
Yes, I have the write checkbox selected
> To help me understand the problem. Excel to to run on the server-side,
> right?
That's the idea, yes ...
> You mentioned granting folder permissions on the server to the client.
> This is not typical of an ASP application.
I know it's not typical, but I've read some old messages in this newsgroup
commenting the need of doing it.
Thanks for your help!
Control Panel
Services
WWW service
Logon tab
check Allow service to interact with desktop