View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default "This macro calls that macro, which calls .."-how many?

Ed,

When a macro calls a macro which calls a macro, and so on, the "chain" of
macros is stored in what is called the Call Stack. The Call Stack can hold
several thousand entries before a "Stack Overflow" error occurs, so you
should be safe unless you are using recursion, in which a macro calls
itself. Logic flaws in recursive procedures are the most common cause of
stack overflows.


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

"Ed" wrote in message
...
I've jsut finished looking at all the code I have to complete a certain
project. I realized that in some places, I have a macro calling a macro,
which calls another one. In fact, it may go four deep, and the "parent"
won't close until the last "grandchild" is completed. How many can be
*SAFELY* stacked up like this? Is there a point at which you reach
instability, with workbooks opening and closing, saving and claculating in
macros within macros?

Ed