XL7: Illegal Operation Using OpenDatabase with Open Database

Last reviewed: September 2, 1997
Article ID: Q133199
The information in this article applies to:
  • Microsoft Excel for Windows 95, version 7.0

SYMPTOMS

In Microsoft Excel, when you run a macro that uses the OpenDatabase method to open a database and return a reference to a database object that is currently open in Microsoft Excel, you receive an Illegal Operation error in Microsoft Excel. If you click Details, a message similar to the following appears:

   EXCEL caused an invalid page fault in module VBA32.DLL at
   0137:00b3b392.

CAUSE

This problem occurs when the existing database file that you open using the OpenDatabase method is open in Microsoft Excel. For example, when you run the following macro, you receive an Illegal Operation error in Microsoft Excel if Book1.xls is currently open:

   Sub Test()
     Dim MyData as Database
     Set MyData = OpenDatabase("Book1.xls", _
      False, False, "Excel 5.0")
   End Sub

Note that this problem occurs regardless of whether the database file is open in the current session of Microsoft Excel or in another session of Microsoft Excel.

Note that you may receive the following error message instead of the Illegal Operation error message when you run this macro or when you step through this macro:

   Run-time error '28':

   Out of stack space

RESOLUTION

To avoid this problem, make sure that the database file that you want to open using the OpenDatabase method is not open in the current session of Microsoft Excel.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

REFERENCES

For more information about using the Microsoft DAO 3.0 Object Library, click the Index tab in Microsoft Excel Help, type the following text

   DAO Overview

and then double-click the selected text to go to the "Data Access Objects Overview" topic.


Additional query words: 7.00

Keywords : kbprg PgmOthr xlwin kbcode
Version : 7.00
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: September 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.