ACC: OLE MS Excel, Word Do Not Close When Form Is Closed

ID: Q96465


The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0, 97


SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

Microsoft Access does not close some OLE servers if you close a table, a form, or a report while editing an OLE object embedded in it.


STATUS

This behavior is by design.


MORE INFORMATION

Microsoft Access does not close Multiple Document Interface (MDI) applications that do not support in-place activation, even if they were started as an OLE server for an object stored in Microsoft Access. An MDI application can edit and display multiple documents at once.

Microsoft Excel version 3.0 and Microsoft Word version 2.0 for Windows are examples of applications that remain open if you double-click an embedded object in Microsoft Access to activate it, and then switch back to Microsoft Access and close the table, form, or report without closing the embedded object.

Steps to Reproduce Behavior


  1. Open the sample database Northwind.mdb (or Nwind.mdb in earlier versions).


  2. Create a new form not based on a table or query and open it in Design view.


  3. On the Insert menu, click Object (or on the Edit menu, click Insert Object in versions 1.x and 2.0).


  4. Select Microsoft Excel Worksheet in the Object Type box, and then click OK.


  5. When a new worksheet opens in Microsoft Excel, type some sample text in a few cells, and then exit Microsoft Excel.


  6. Set the following properties of the new embedded object control on the form:

    Enabled: Yes Locked: No


  7. Save the form as frmExcel and close it.


  8. Open the frmExcel form in Form view.


  9. Double-click the embedded Excel worksheet object that you just created.


  10. When Microsoft Excel opens and displays the worksheet, minimize Microsoft Excel and then close the Microsoft Access form.


  11. Note that Microsoft Excel is still open. You must activate the Microsoft Excel window and quit the program manually.


If you repeat these steps with applications such as Paintbrush, Microsoft Draw, or Note-It (these are not MDI applications), you will note that these servers close when the form closes.

Keywords : IntpOle
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: March 20, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.