Microsoft KB Archive/288366

= How to configure Office applications to run under the interactive user account =

Article ID: 288366

Article Last Modified on 3/28/2007

-

APPLIES TO


 * Microsoft Office Access 2007
 * Microsoft Office Access 2003
 * Microsoft Access 2002 Standard Edition
 * Microsoft Access 2000 Standard Edition
 * Microsoft Access 97 Standard Edition
 * Microsoft Office Excel 2007
 * Microsoft Office Excel 2003
 * Microsoft Excel 2002 Standard Edition
 * Microsoft Excel 2000 Standard Edition
 * Microsoft Excel 97 Standard Edition
 * Microsoft Office Word 2007
 * Microsoft Office Word 2003
 * Microsoft Word 2002 Standard Edition
 * Microsoft Word 2000 Standard Edition
 * Microsoft Word 97 Standard Edition

-



This article was previously published under Q288366



SUMMARY
We do not recommend or support Automation to a Microsoft Office application from an unattended user account. For more information about why we do not recommend Automation in this context, click the following article number to view the article in the Microsoft Knowledge Base:

257757 Considerations for server-side Automation of Office

If there is no choice but to automate Office from an unattended user account, use the steps in this article to configure the computer to run the Office application as the interactive user.



MORE INFORMATION
Caution Automation of any Office application from an unattended, non-interactive user account is risky and unstable. A single error in code or configuration can result in a dialog box that can cause the client process to stop responding (hang), that can corrupt data, or that can even crash the calling process (which can bring down your Web server if the client is ASP).

Warning Office was not designed, and is not safe, for unattended execution on a server. Developers who use Office in this manner do so at their own risk.

Regardless, it may absolutely required to use Office in this manner. In these cases, special configuration must be done to avoid errors on Office startup. The steps in this article demonstrate how to configure Office to run as the interactive user account when it is started for Automation.

When you automate under the interactive user account, you should be aware of the following problems:
 * Normally, the Interactive User is defined as the the user that is logged on to the local console (that is, the user who is physically at the computer). On computers that use Microsoft Windows 2000 Terminal Services or Microsoft Windows XP Terminal Services, the Interactive User is defined as a user who is logged on to the local console or a user who is connected to the computer through a remote Terminal Server client.
 * When it is started through automation, the Office application always runs under the security context of the user that is doing the automation. If the user is logged on to the server locally, the application runs under that user context. If a user is connected through a Terminal Server session, the application runs under that user account.

Note If you have multiple Terminal Server connections, the application runs under the context of each user who is logged on.
 * When the Office application is started from a user context that does not have interactive privileges (such as the SYSTEM account), a user must be logged on to the server at the local console, regardless of whether Terminal Services is being used, otherwise an error occurs and the application does not start.

The following table shows some scenarios you may experience when an Office application is configured to run as the Interactive User:

Because the changes in DCOM are global, configuring Office in this manner can have negative side effects for other clients on the system that use Office. It is possible that another client application will not be able to use the Office application after the settings are made. Consider carefully what impact this has to your server before you make any changes to the DCOM configuration settings.

If the problems listed here are too great for your design, or cause other unidentified problems, it is possible to configure Office differently and still allow it to start from an unattended process or service. For more information, click the following article numbers to view the articles in the Microsoft Knowledge Base:

288367 How to configure Office applications to run under a specific user account

288368 How to configure Office applications for automation from a COM+/MTS package

Configuring Office as the interactive user
To set up an Office Automation server under the interactive user account, follow these steps:  Log on to the computer as the Administrator and install (or reinstall) Office using a complete install. For system robustness, it is recommended that you copy the contents of the Office CD-ROM to a local drive and install Office from this location. Start the Office application that you intend to automate. This forces the application to register itself. After the application is running, press ALT+F11 to load the Microsoft Visual Basic for Applications (VBA) editor. This forces VBA to initialize itself. Close the applications, including VBA. Click Start, click Run, and then type DCOMCNFG. Select the application that you want to automate. The application names are listed in the following table.

Click Properties to open the property dialog box for this application. Click the Security tab. Verify that Use Default Access Permissions and Use Default Launch Permissions are selected. Click the Identity tab and then select The Interactive User.</li> Click OK to close the property dialog box and return to the main applications list dialog box.</li> In the DCOM Configuration dialog box, click the Default Security tab.</li> Click Edit Defaults for access permissions. Verify that the following users are listed in the access permissions, or add the users if they are not listed: <ul> SYSTEM</li> INTERACTIVE</li> Everyone</li> Administrators</li> IUSR_ (See note)</li> IWAM_ (See note)</li></ul>

Note These accounts only exist if Internet Information Server (IIS) is installed on the computer.</li> Make sure that each user is allowed access and click OK.</li> Click Edit Defaults for launch permissions. Verify that the following users are listed in the launch permissions, or add the users if they are not listed: <ul> INTERACTIVE</li> Everyone</li> Administrators</li> IUSR_ (See note)</li> <li>IWAM_ (See note)</li></ul>

Note These accounts exist only if IIS is installed on the computer.</li> <li>Make sure that each user is allowed access, and then click OK.</li> <li>Click OK to close DCOMCNFG.</li> <li> Start Registry editor and verify that the following keys and string values exist for the Office application that you want to automate:

Microsoft Office Access 2003/2007:

Key:

AppID: {73A4C9C1-D68D-11D0-98BF-00A0C90DC8D9}

Microsoft Access 2000/2002:

Key:

AppID: {73A4C9C1-D68D-11D0-98BF-00A0C90DC8D9}

Microsoft Access 97:

Key:

AppID: {8CC49940-3146-11CF-97A1-00AA00424A9F}

Microsoft Office Excel 2003/2007:

Key:

AppID: {00020830-0000-0000-C000-000000000046}

Microsoft Excel 97/2000/2002:

Key:

AppID: {00020812-0000-0000-C000-000000000046}

Microsoft Office Word 2003/2007:

Key:

AppID: {C184E717-402A-438F-B99E-77C2CD4091C8}

Microsoft Word 97/2000/2002:

Key:

AppID: {00020906-0000-0000-C000-000000000046}

If these keys do not exist, you can create them by running a .reg file on your computer that resembles the following .reg file: REGEDIT4

[HKEY_CLASSES_ROOT\AppID\WINWORD.EXE] &quot;AppID&quot;=&quot;{00020906-0000-0000-C000-000000000046}&quot;

[HKEY_CLASSES_ROOT\AppID\EXCEL.EXE] &quot;AppID&quot;=&quot;{00020812-0000-0000-C000-000000000046}&quot;

[HKEY_CLASSES_ROOT\AppID\MSACCESS.EXE] &quot;AppID&quot;=&quot;{73A4C9C1-D68D-11D0-98BF-00A0C90DC8D9}&quot; Note The sample .reg file is for Access 2000 or Access 2002. If you are using Access 97, change the AppID key to: &quot;AppID&quot;=&quot;{8CC49940-3146-11CF-97A1-00AA00424A9F}&quot; </li> <li>Restart the system. This is required.</li></ol>

<div class="references_section">