error 28: out of stack space :: MrExcel Message Board



 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

error 28: out of stack space
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

Calicat
Board Master


Joined: 18 Apr 2003
Posts: 142
Location: Boston, Mass
Flag: Usa

Status: Offline

 Reply with quote  

error 28: out of stack space

Does anyone know what this means?

Post Fri Sep 19, 2003 8:24 pm 
 View user's profile Send private message

Juan Pablo González
MrExcel MVP


Joined: 09 Feb 2002
Posts: 8580
Location: Marion, IL
Flag: Colombia

Status: Offline

 Reply with quote  

Re: error 28: out of stack space

In practice, that you have an endless loop, a recursive call to your sub/function that never ends...
_________________
Regards,

Juan Pablo González
MrExcel.com Consulting

Read the Articles List and check out our Recommended links and Add-Ins

Post Fri Sep 19, 2003 8:37 pm 
 View user's profile Send private message Visit poster's website

Calicat
Board Master


Joined: 18 Apr 2003
Posts: 142
Location: Boston, Mass
Flag: Usa

Status: Offline

 Reply with quote  

Re: error 28: out of stack space

OK, that makes sense. The part of my macro that is not working could definately cause this. Thanks!

Post Fri Sep 19, 2003 8:42 pm 
 View user's profile Send private message

parry
MrExcel MVP


Joined: 21 Aug 2002
Posts: 1332
Location: Wellington, New Zealand
Flag: Newzealand

Status: Offline

 Reply with quote  

Re: error 28: out of stack space

Hi, in VBeditor, select Help and in the Answer Wizard tab search for trappable errors. Brings up a list of the error numbers. Heres an extract in case you cant find it (took me ages to find it in help)...

Out of stack space (Error 28)


The stack is a working area of memory that grows and shrinks dynamically with the demands of your executing program. This error has the following causes and solutions:

You have too many active Function, Sub, or Property procedure calls.
Check that procedures aren't nested too deeply. This is especially true with recursive procedures, that is, procedures that call themselves. Make sure recursive procedures terminate properly. Use the Calls dialog box to view which procedures are active (on the stack).

Your local variables require more local variable space than is available.
Try declaring some variables at the module level instead. You can also declare all variables in the procedure static by preceding the Property, Sub, or Function keyword with Static. Or you can use the Static statement to declare individual Static variables within procedures.

You have too many fixed-length strings.
Fixed-length strings in a procedure are more quickly accessed, but use more stack space than variable-length strings, because the string data itself is placed on the stack. Try redefining some of your fixed-length strings as variable-length strings. When you declare variable-length strings in a procedure, only the string descriptor (not the data itself) is placed on the stack. You can also define the string at module level where it requires no stack space. Variables declared at module level are Public by default, so the string is visible to all procedures in the module.

You have too many nested DoEvents function calls.
Use the Calls dialog box to view which procedures are active on the stack.

Your code triggered an event cascade.
An event cascade is caused by triggering an event that calls an event procedure that's already on the stack. An event cascade is similar to an unterminated recursive procedure call, but it's less obvious, since the call is made by Visual Basic rather than by an explicit call in your code. Use the Calls dialog box to view which procedures are active (on the stack).

To display the Calls dialog box, select the Calls button to the right of the Procedure box in the Debug window or choose the Calls command. For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

Post Fri Sep 19, 2003 8:47 pm 
 View user's profile Send private message

Calicat
Board Master


Joined: 18 Apr 2003
Posts: 142
Location: Boston, Mass
Flag: Usa

Status: Offline

 Reply with quote  

Re: error 28: out of stack space

OK...wow...thanks!!!!!!! I will read thru this. Perhaps what I said before is wrong...

Calicat

Post Fri Sep 19, 2003 8:54 pm 
 View user's profile Send private message

Iridium
Board Master
Board Master


Joined: 16 Jul 2002
Posts: 2581
Location: Walsall, England
Flag: England

Status: Offline

 Reply with quote  

Re: error 28: out of stack space

Pop yor macro up on the board
_________________

Post Fri Sep 19, 2003 8:54 pm 
 View user's profile Send private message

Calicat
Board Master


Joined: 18 Apr 2003
Posts: 142
Location: Boston, Mass
Flag: Usa

Status: Offline

 Reply with quote  

Re: error 28: out of stack space

It is very rough...let me play with it and I'll post monday am, so I am not totally embarrassed. It is closely tied to aother post I just made to Wil Moosa....I am having trouble with the function sub and how to modify the macro for only the filename and not entire pathway.

I think I have too many nested(?) select case statements...and no clue how to modufy the function subroutine.

I'll post back ASAP. Thanks Iridium...

Post Fri Sep 19, 2003 9:08 pm 
 View user's profile Send private message
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.