Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help needed: problem when executing an Excel macro from an asp page

2 views
Skip to first unread message

Mikel

unread,
Aug 5, 2002, 5:52:36 AM8/5/02
to
Hi all,

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

guy

unread,
Aug 5, 2002, 6:05:46 AM8/5/02
to
1. Did you allow write access to the local path in IIS MMC Home
Directory tab for this website? (Do this only if you really want to.)

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")

Mikel

unread,
Aug 5, 2002, 7:34:33 AM8/5/02
to

"guy" <g...@hotmail.com> escribió en el mensaje
news:dgiskug9u9cv52gop...@4ax.com...

> 1. Did you allow write access to the local path in IIS MMC Home
> Directory tab for this website? (Do this only if you really want to.)

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.


guy

unread,
Aug 5, 2002, 7:21:59 AM8/5/02
to
Just to make things clearer for me, we are talking about IIS security
properties here. Right?

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.

Mikel

unread,
Aug 5, 2002, 9:09:14 AM8/5/02
to

"guy" <g...@hotmail.com> escribió en el mensaje
news:fdmskuka9m9b39bik...@4ax.com...

> Just to make things clearer for me, we are talking about IIS security
> properties here. Right?
>
> Open the IIS MMC
> Highlight your website
> Properties menu
> Home Diretory tab
> Write checkbox for local path

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!

guy

unread,
Aug 5, 2002, 9:15:08 AM8/5/02
to
Have you tried running Excel visible on the server and check if there
is a dialog waiting for response?

Control Panel
Services
WWW service
Logon tab
check Allow service to interact with desktop

0 new messages