Summary
Microsoft Office applications such as Word, Access, and Excel are not designed (or supported) for "server-side" automation, which can lead to problems when these applications are run by adTempus jobs.
More Information
Microsoft's Considerations for server-side Automation of Office document discusses the problems with running Microsoft Office applications in a server-side environment. It includes this statement of compatibility and support:
All current versions of Microsoft Office were designed, tested, and configured to run as end-user products on a client workstation. They assume an interactive desktop and user profile. They do not provide the level of reentrancy or security that is necessary to meet the needs of server-side components that are designed to run unattended.
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
The following sections discuss problems you may encounter when running Microsoft Office applications from adTempus jobs.
Problems with Non-Interactive Execution
The most common source of problems is the fact that Office applications are designed to be run as interactive applications, while adTempus is designed primarily to run non-interactive applications.
Because Microsoft Office applications assume they are being run interactively, they may display windows/dialog boxes to report error conditions. By default adTempus runs jobs using a non-interactive logon session, which means that those windows are not visible to any user on the computer. Consequently if an Office application displays an error message, the job will appear to be "hung" or stuck, because the Office application is waiting for a user to acknowledge the error message, and adTempus is waiting for the Office application to exit.
Temporary Interactive Execution
If your Office application is not behaving correctly, for testing purposes you can temporarily run your job in interactive mode to see if an error is being displayed. To do this, log in to the computer where adTempus is running, using the same user account that the job is configured to use. Execute the job manually, and in the Execute Job window check the Make the job visible on my desktop box. The job will now run interactively and you will be able to see the Office application's user interface. If any error messages are displayed, you will be able to see them.
Permanent Interactive Execution
In some cases you may need to permanently configure your job to run interactively. For example, if your Office automation task frequently encounters errors and displays error messages, you need the user interface to be visible so they can be resolved.
To accommodate this you can set the User Interaction setting for the job to "Interaction Required" so that the job always runs in an interactive session. This way if an error message is displayed or the Office application hangs for any other reason, you will be able to interact with it to resolve the problem.
However, the user whose account the job is configured to run under must be logged in to the computer at all times. For example, if the job is configured to run under the account "automation", then the "automation" user must be logged in to the computer interactively (the desktop can be locked, but the user must be logged in). This is the only way to provide an interactive logon session for adTempus to run the job in. If the user is not logged in when the job needs to run, adTempus will not run the job, and will report it as a failure.
Concurrent Execution Problems
When you run a script or program that "drives" an Office application through its automation interface, a separate copy of the Office application is started for each automation client. Because Office applications are not designed to have more than one copy running, this can cause problems, such as:
- Conflicts over shared resources such as files
- Problems with excessive memory usage.
Related Articles
The following articles address related problems or specific error scenarios: