UNCONF: Out of Stack Space Error Calling QueryGetData

ID: Q135391


The information in this article applies to:
  • Microsoft Excel for Windows, version 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.
    
        


  2. -or-

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


  4. -or-

  5. 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
Version : WINDOWS:5.0c
Platform : WINDOWS
Issue type :


Last Reviewed: October 18, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.