I have several scripts that use COM to do miscellaneous reports through Excel and Word. They worked fine up until yesterday. Now for some odd reason, the only way they will work is through the debugging engine in Zend Studio or by running it through a command prompt. They won't work when pulling up the script in a web browser.

The only thing I have done lately is install Perl and that gets me wondering if installing it has messed with my IIS permissions, but I can't seem to find anything that points to that. Any thoughts?

[UPDATE]

Okay, so I've done a system restore to rollback to before installing PERL. Still no luck. A little more information though...when debugging in Zend Studio, still no problems. When I start it in the browser, the browser goes blank, and doesn't throw an error, however, MS Word is not visible--BUT IT IS running in task manager. Here's the simplest code I could try with it

<?php
$word = new COM("Word.Application");
$word->Visible = true;
?>

MS Word pops up when debugging and in command line mode, but nothing through browser.

    Not sure about IIS and "debug mode", but I know this is the case with Apache so I'll assume it's the same issue:

    The webserver daemon is run as a Windows service. Windows has permissions and whatnot to manage not only how services are run, but also what they can do.

    Try opening the Services MMC (Control Panel, Administrative Tools, Services), going to the properties of "World Wide Web Publishing Service", clicking on the Log On tab, and placing a check in the box "Allow service to interact with desktop".

    Note that you will have to completely restart IIS for this change to take affect.

      That feature was already enabled, but I double-checked to make sure...

      Still no luck.

        The use of things like Excel and Word in a server application is not recommended - they aren't robust enough for production use and are likely to kill your server.

        Consider an alternative solution, possibly involving a third party component.

        Run your application from the command line in an interactive session, and you may see the errors as dialogue boxes. But there are further outstanding issues that cannot easily be resolved, which make MSWord and Excel unsuitable for use in a production server environment.

        Mark

          Write a Reply...