UNCONF: Out of Stack Space Error Calling QueryGetData

Last reviewed: September 2, 1997
Article ID: Q135391
The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0c

*********************************************************************

**                           - WARNING -                           **
**     THE INFORMATION BELOW IS PRELIMINARY AND HAS NOT BEEN       **
**     CONFIRMED, EDITED, OR TESTED BY MICROSOFT. USE ONLY         **
**     WITH DISCRETION.                                            **
*********************************************************************

SYMPTOMS

Microsoft Excel for Windows version 5.0c, may produce the following error message when calling a procedure that uses the xlquery.xla QueryGetData function:

   Run-time error '28':
   "Out of Stack Space"

CAUSE

Using the macro recorder, when you record clicking Get External Data on the Data menu in Microsoft Excel for Windows version 5.0c, selecting a data source in Microsoft Query, adding a table, performing a query and returning your data to Microsoft Excel, the recorded code you end up with is a series of application.run "QueryGetData" commands. This command is found in the xlquery.xla add-in file which ships with Microsoft Excel.

If you create a Sub procedure which calls this recorded macro using the application.run method and assign this sub procedure to a custom toolbar button or a button on your worksheet, you will receive the above error message when you click the button. You will also receive the error message if you attempt to run your Sub procedure by placing the pointer cursor on any line of the Sub procedure and clicking the built-in macro run toolbar button found on the Visual Basic toolbar.

RESOLUTION

To avoid the above error message do one of the following:

  1. Run your macro by clicking Macro on the Tools menu and selecting your
       Sub procedure from the listing of available macros and pressing Run.
    
       -or-
    
    

  2. Place the pointer on any line of your calling procedure and press the F5 key.

    -or-

  3. Assign the Sub procedure to a custom menu option and run it from there.

Rather than using the QueryGetData command, use the SQLOpen, SQLExecQuery, SQLRetrieve, and SQLClose methods for retrieving data from your external data source.

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

This behavior does not occur in Microsoft Excel version 5.0 for Windows or Microsoft Excel version 5.0 for Macintosh.

REFERENCES

For more information about these commands, refer to Help in Microsoft Excel. Choose Contents from the Help menu, choose Programming With Visual Basic from the Contents screen and then choose search and type in SQL. This will take you to a listing of all of the SQL commands available in Microsoft Excels Visual Basic for Applications programming language.


Additional query words: 1.00 MSQuery VB
Keywords : kbprg PgmOthr kberrmsg kbprg
Version : 5.00c
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.