XL2000: Out of Stack Space Error With Recursive Subroutine and Loop Structure (266156)
The information in this article applies to:
This article was previously published under Q266156 SYMPTOMS
When you run a Microsoft Excel Visual Basic for Applications subroutine you receive the following error:
Run Time Error 28: Out of Stack Space CAUSE
The error message appears if both of the following conditions are true: - You call the same Visual Basic for Applications subroutine that you are running from within itself (recursively).
-and-
- The subroutine call is designed to run over and over again from within a loop.
WORKAROUND
To work around this behavior, use a GoTo statement in your code to branch to a previous line label instead of calling the name of the subroutine itself.
REFERENCESFor more information about using the GoTo statement and line labels, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type GoTo Statement in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kberrmsg kbprb KB266156 |
---|
|