Microsoft KB Archive/133199

= Illegal Operation Using OpenDatabase with Open Database =

Article ID: 133199

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Excel 95 Standard Edition

-



This article was previously published under Q133199



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.

