error 28: out of stack space

OK, that makes sense. The part of my macro that is not working could definately cause this. Thanks!
 
Upvote 0
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).
 
Upvote 0
OK...wow...thanks!!!!!!! I will read thru this. Perhaps what I said before is wrong...

Calicat
 
Upvote 0
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...
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top