Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
"This macro calls that macro, which calls .."-how many?
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
"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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
"This macro calls that macro, which calls .."-how many?
Thank you - and may I NEVER!! see a thousand macros stacked up! It's hard
enough keeping track of the half-dozen I use for this project! 8\ Ed "Chip Pearson" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
2007 Need macro to auto set option buttons all to "Yes" or "No" | Excel Worksheet Functions | |||
Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing" | Excel Discussion (Misc queries) | |||
Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing" | Excel Discussion (Misc queries) | |||
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" | Excel Discussion (Misc queries) | |||
Attn: Dave P. Question re Pix Calls via Macro | Excel Discussion (Misc queries) |