PRA: Exception Error Referencing Application Object on NT 4.0

Last reviewed: April 8, 1997
Article ID: Q161332
97 WINDOWS kberrmsg

The information in this article applies to:

  • Microsoft Access 97 on the following platform: Windows NT
  • Microsoft Excel 97 on the following platform: Windows NT
  • Microsoft Word 97 on the following platform: Windows NT

SYMPTOMS

Advanced: Requires expert coding, interoperability, and multiuser skills.

When you reference the Application object of an Automation server, such as Microsoft Access 97, Microsoft Excel 97, or Microsoft Word 97, you receive the following error message on Microsoft Windows NT 4.0, Service Pack 1:

   An application error has occurred and an application error log is being
   generated.

The error message also references the executable file for the application that was running the Automation code, such as MSACCESS.EXE.

RESOLUTION

There are two ways to work around this problem:

Method 1

Install Microsoft Windows NT 4.0, Service Pack 2. This problem only occurs on Microsoft Windows NT 4.0, Service Pack 1.

Method 2

Do not use early binding to reference the Application object. Early binding occurs when you declare a variable as an application-defined object type, for example:

   Dim xlobj as Excel.Application

Use late binding instead. Late binding occurs when you declare a variable as an object rather than an application, for example:

   Dim xlobj as Object
   Set xlobj = CreateObject("Excel.Application")

For more information about early and late binding, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q147816
   TITLE     : INF: Using Microsoft Access as an Automation Server

STATUS

Microsoft has confirmed this to be a problem in Microsoft NT version 4.0, Service Pack 1. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

WARNING: Following these steps will cause an exception error on your computer. Make sure you save and close any open work on your computer before following these steps.

  1. Start Microsoft Access 97 on a computer running Microsoft Windows NT 4.0 SP1.

  2. Open the sample database Northwind.mdb.

  3. Create a module and type the following procedure:

          Sub XLTest()
             Dim xlobj as New Excel.Application
             xlobj.Visible = True
          End Sub
    
    

  4. While the module is open in Design view, click References on the Tools menu.

  5. Click Microsoft Excel 8.0 Object Library in the Available References box, and then click OK. If Microsoft Excel 8.0 Object Library is not visible, click the Browse button and browse your hard drive for the file Excel8.olb.

  6. To test this procedure, type the following line in the Debug window, and then press ENTER.

           XLTest
    

    Note that you receive the exception error.

REFERENCES

For more information about Creating Automation Objects, search the Help Index for "New keyword" or "CreateObject function."


KBCategory: kberrmsg
KBSubcategory:
Additional query words: 97 OFF97 SP1 SP2 GetObject 8.00
Keywords : kberrmsg
Version : 97
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.