Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default "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   Report Post  
Posted to microsoft.public.excel.programming
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default "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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2007 Need macro to auto set option buttons all to "Yes" or "No" Paula Excel Worksheet Functions 1 October 20th 09 08:07 PM
Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing" ldiaz Excel Discussion (Misc queries) 2 March 16th 08 09:23 PM
Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing" ldiaz Excel Discussion (Misc queries) 2 March 15th 08 07:26 PM
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" Dennis Excel Discussion (Misc queries) 0 July 17th 06 02:38 PM
Attn: Dave P. Question re Pix Calls via Macro DocuMike Excel Discussion (Misc queries) 1 January 10th 05 01:38 AM


All times are GMT +1. The time now is 06:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"