in reply to Re: win32::ole runs under cmd line but not cgi
in thread win32::ole runs under cmd line but not cgi

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
  • Comment on Re^2: win32::ole runs under cmd line but not cgi

Replies are listed 'Best First'.
Re^3: win32::ole runs under cmd line but not cgi
by CountZero (Bishop) on Jul 24, 2005 at 18:47 UTC
    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

      I know this has been a long time, I am facing similar issue. Is there a common approach for this issue? Although I am not getting the error as stated here, I am still not able to open the file and my code dies when executed via the webserver. Also, I am authenticating my users using SSPI. So I do have the remote_user variable set. But does not seem to help in authenticating for file access via Win32::OLE. Any other way to run a macro from .xlsm file in perl?
        Running an Excel spreadsheet macro inside the webserver seems a very bad idea to me. It will involve so much overhead that response times will suffer.

        Can you log in on the server using the credentials of the web-server? Are you then able to open the spreadsheet and run the macro?

        CountZero

        A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

        My blog: Imperial Deltronics