XL97: Excel Object Is Not Closed After Running Macro

ID: Q179028

The information in this article applies to:

SYMPTOMS

When you close a document that contains a Microsoft Excel worksheet object, the worksheet remains open in Excel.

CAUSE

This problem occurs when the following conditions are true:

STATUS

Microsoft has confirmed this to be a problem in Microsoft Excel 97 for Windows. This problem was corrected in Microsoft Office 97 Service Release 2 (SR-2).

For additional information about SR-2, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q151261
   TITLE     : OFF97: How to Obtain and Install MS Office 97 SR-2

MORE INFORMATION

Example of the Problem

To see an example of the problem, follow these steps:

 1. Start Excel.

 2. Start the Visual Basic Editor (press ALT+F11).

 3. On the Insert menu, click Module.

 4. Type the following code into the Visual Basic module sheet:

       Sub Test1()

          ActiveWorkbook.Names.Add Name:="Name1", RefersTo:="=Sheet1!a1"

       End Sub

 5. On the File menu, click "Close and Return to Microsoft Excel."

 6. On the File menu, click Save As. Type "Test.xls" (without the quotation
    marks) in the File Name box, and then click OK.

 7. On the File menu, click Exit.

 8. Start Word.

 9. On the Insert menu, click Object. Click the Create From File tab in
    the Object dialog box. Type "Test.xls" (without the quotation marks),
    and then click OK. Click Yes if a macro virus protection warning
    message appears.

    The Excel workbook is inserted into the Word document.

10. Right-click the embedded Excel object, point to Worksheet Object on the
    shortcut menu, and then click Open.

11. In Excel, Point to Macro on the Tools menu, and then click Macros.
    Click Test1, and then click Run.

12. On the File menu, click "Close & Return to Document1."

The worksheet remains open in Excel.

Additional query words: vba cannot access accessing

Keywords          : kbprg kbdta xlvbainfo 
Version           : WINDOWS:97,97sr2
Platform          : WINDOWS
Issue type        : kbbug

Last Reviewed: November 6, 1998