Re: win32::ole runs under cmd line but not cgi
by davidrw (Prior) on Jul 23, 2005 at 14:44 UTC
|
few questions/thoughts:
- what's the exact output when you run it from the command line?
- When you run from the cmdline, does an excel window visibly open? From cgi, you probably want the window to be hidden (i forget offhand the code tweak for it)
- Use LiveHTTPHeaders for firefox to see what it's really sending back.
| [reply] |
|
|
For the second bullet item I believe you're thinking of
$Excel->{'Visibile'} = 0;
| [reply] [d/l] |
Re: win32::ole runs under cmd line but not cgi
by dorko (Prior) on Jul 23, 2005 at 14:46 UTC
|
Whenever someone says "it works fine from the command line but it doesn't work as CGI..." it makes me think of users' permissions. The user executing CGI scripts is oftentimes a special web user with limited access. When you run the same script from the command line, you're logged in as a user with rights and permissions that are usually quite different from the web user.
It may or may not help, but it's something to think about.
Cheers,
Brent
| [reply] |
|
|
Thank you. It looks like you nailed the problem. Now i just have to figure out how to have perl be recognized as having the appropriate permissions.
| [reply] |
|
|
Hi
Let Me know how to solve the issues when I am using the Apache with Windows2003
| [reply] |
Re: win32::ole runs under cmd line but not cgi
by CountZero (Bishop) on Jul 23, 2005 at 20:38 UTC
|
The " Premature end of script headers" error most of the times means that something gets output to the client prior to the HTTP-headers having been fully output. What is being output is therefore the big question. Probably some error message your Perl script generates and I'm guessing it is "error 0x80080005" (whatever that may mean).Another question: what are you trying to achieve with this script? It looks as it is not sending anything back to the client and neither are you collecting something from the client, so the whole operation looks rather useless to me, but I'm sure I must be missing something.
CountZero "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
| [reply] [d/l] |
|
|
You're right, on the surface the code looks useless. But what i have before me is a a collection of macros written by various folks over a period of years in vbasic for applications in Microsoft Office. The little example executes a an excel macro that checks a directory for uploaded files, moves them to appropriate directories, then performs a variety of error checks and linguistic transliterations on the files and then sends them on to directories accessable to several databases (Oracle, Informix, MS Access based). But, i see what you're getting at. Perhaps i should provide some output (in appropriate html). I'll try it.
thanks
| [reply] |
|
|
I see, the (in)famous legacy problem. Say no more, we suffer from similar problems.May I suggest another solution? Rather than starting the Perl program to start Excel from the server, have the Perl program started regularly from a cron-like program at regular intervals. No need to bother the server and if the intervals are small enough, the various users should not have to wait too long before the files show up in the right directories. That being said, I should start thinking of transferring all these VBA-programs to Perl as it seems something for which Perl is really made. It is still time to apply for a budget for such project for next year!
CountZero "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
| [reply] |
|
|
|
|
|
Re: win32::ole runs under cmd line but not cgi
by holli (Abbot) on Jul 23, 2005 at 20:09 UTC
|
The following 2 questions may be obvious and self evident, but i'll ask them:
- Are you sure the server runs windows?
- If it does, are you sure Excel is installed?
| [reply] |