"File in Use by Another Program" After OLE Automation SessionLast reviewed: February 6, 1998Article ID: Q105410 |
The information in this article applies to:
SYMPTOMSIf you run an OLE 2.0 automation session in which you create a WordBasic object in a client application (such as Microsoft Visual Basic version 3.0) that accesses Word for Windows as a server, the following error message may occur in the next session of Word when you try to save your NORMAL.DOT file:
This file is in use by another application or user. (<path>\NORMAL.DOT) CAUSEThe Word command line in your Windows REG.DAT file does not include the /Automation switch. Specifically, in the CLSID key, under the WordBasic (WordBasic) Class ID key, the LocalServer key value must include the /Automation switch. If this switch is missing, the OLE 2.0 Automation (OLE Auto) transaction launches a session of Word that is not completely removed from memory when you close Word. In other words, it remains in memory as a "ghost" Word session. As a result, the file handle to the NORMAL.DOT file remains open, and this prevents you from saving NORMAL.DOT in a later Word session. The "ghost" Word session does not appear in the Windows Task List. The only way to close it is to exit and restart Windows.
WORKAROUNDSave your NORMAL.DOT file to a different name such as NORMAL.OLD, then exit Word. Exit and restart Windows. If necessary, you can rename NORMAL.OLD to NORMAL.DOT. Then resolve this problem using the steps in the Resolution section below.
RESOLUTIONUse one of the following methods to add the /Automation switch to your REG.DAT file.
Method 1: Merge WINWORD6.REG Registration FileNote: The WINWORD6.REG file contains information based on the options you chose when you originally set up Word. If the location of WINWORD.EXE or any of the OLE applications supplied with Word has changed since you first installed Word, the WINWORD6.REG file will not correctly update your registration information. In this case, you should use Method 2 below instead.
Method 2: Manually Edit the REG.DAT FileUse the following instructions to add the /Automation switch to your REG.DAT file:
MORE INFORMATIONBy default, the Word Setup program adds the /Automation command line switch to REG.DAT. If you manually delete this switch, Word does not restore it the next time you start Word.
|
KBCategory:
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |