BUG: Excel Does Not Quit If an Embedded Workbook Has a Smart Document Attached (825959)



The information in this article applies to:

  • Microsoft Office Excel 2003

SYMPTOMS

When you have a Microsoft Office Excel 2003 workbook with an attached Microsoft Office 2003 Smart Document and you open that Excel 2003 workbook inside an OLE container or inside an ActiveX Document container, Excel does not quit when you move away from the workbook or when you close the container. The Excel application process remains in the Task list and holds a lock on the workbook that you previously opened.

CAUSE

This problem may occur for the following reasons:
  • You store a reference to the Excel workbook as a public variable.
  • You store a reference to the Excel workbook as a variable that is scoped to your class that implements the ISmartDocument interface.

STATUS

Microsoft has confirmed that this is a bug in Microsoft Office Excel 2003.

MORE INFORMATION

Steps to Reproduce the Problem

The following steps use the SimpleSampleVB6 sample that is installed with the Office 2003 Smart Document software development kit (SDK). To make sure that the following steps work correctly, you must install the SDK at <smartdocsdk_location> on your computer.
  1. Modify the SimpleSampleVB6 Smart Document:
    1. In Microsoft Windows Explorer, move to <smartdocsdk_location>\Samples\SimpleSampleVB6, and then double-click SimpleSample.vbp to open it in Microsoft Visual Basic 6.0.
    2. In the clsActions class module, add a class level Excel Workbook variable as follows:
      Private oBook as Excel.Workbook
    3. Locate the following ISmartDocument_SmartDocInitialize method in the code:
      strPath = Document.Path & "\"
      strApp = Document.Application.Name
      
      Change the ISmartDocument_SmartDocInitialize method to the following code:
      strPath = Document.Path & "\"
      strApp = Document.Application.Name
      Set oBook = Document
      
      Save your changes to the project.
    4. On the File menu, click Make SimpleSample.dll to recompile the library. If you are prompted to overwrite the existing file, click Yes.
  2. In Windows Explorer, move to <smartdocsdk_location>\Samples\SimpleSampleVB6. Right-click SimpleSample.xls, point to Open With, and then click Internet Explorer. If the File Download dialog box appears in Microsoft Internet Explorer, click Open.
  3. Close Internet Explorer.
  4. Start Microsoft Windows Task Manager.

    Notice that the instance of Excel still appears in the Processes list.
  5. In Windows Explorer, move to <smartdocsdk_location>\Samples\SimpleSampleVB6, and then double-click SimpleSample.xls.

    You receive a message that says that SimpleSample.xls is already open.

REFERENCES

For additional information about Office 2003 Smart Document SDK, visit the following Microsoft Web site:

http://www.microsoft.com/downloads/details.aspx?FamilyId=24A557F7-EB06-4A2C-8F6C-2767B174126F&displaylang=en


Modification Type:MajorLast Reviewed:11/14/2003
Keywords:kbBug kbOfficeSmartDoc KB825959