ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   call stack question (https://www.excelbanter.com/excel-programming/278732-call-stack-question.html)

Dave Ring

call stack question
 
Not infrequently, I run into "Out of stack space" run time errors when
running recursive routines. Is there any solution to this other than
eliminating recursion and rewriting the code with my own stack? Is
there, for instance, some way to allocate more room for the VBA call stack?

Dave Ring


Chip Pearson

call stack question
 
Dave,

As far as I know, there is no way to increase stack size. You'll have to
rewrite the code in such as way that it doesn't fill up the stack, e.g.,
eliminating so much recursion.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com

"Dave Ring" wrote in message
...
Not infrequently, I run into "Out of stack space" run time errors when
running recursive routines. Is there any solution to this other than
eliminating recursion and rewriting the code with my own stack? Is
there, for instance, some way to allocate more room for the VBA call

stack?

Dave Ring




Dave Ring

call stack question
 
Pity. Recursion is simpler and clearer than setting up my own stack
arrays, and when I do the latter, I find a depth of 100-200 is usually
adequate. I don't run out of memory, so there seems to be no reason
that VBA couldn't be more generous with its internal stack limit.

Dave

Chip Pearson wrote:
Dave,

As far as I know, there is no way to increase stack size. You'll have to
rewrite the code in such as way that it doesn't fill up the stack, e.g.,
eliminating so much recursion.





All times are GMT +1. The time now is 10:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com