Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2006

Tip: Looking for answers? Try searching our database.

Limits to using Call

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BEEJAY - 23 May 2006 20:22 GMT
Greetings:
I have a new module, consisting of many "subs"
Each one is actually quite small, but very understandable, since each one
refers to one sheet.
Question:
Does the use of many subs (Calls) noticibly affect spead of proceedures?
Is there any limit to the number of subs one can use within a module or
workbook or............

Thanks
Tom Ogilvy - 23 May 2006 20:29 GMT
It takes longer to call a sub to execute some code than it does to execute it
inline.

that said, it is not a significant performance problem and the benefits
probably outweigh the penalties.

The only limitation I am aware of is that if you exported a module to a bas
file, the size of the bas file should be less than 64K.  This isn't a
published limitation, but many have stated it as a rule of thumb which if
ignored can cause problems.

That really has no effect on the number of procedures which I am not aware
of any limit.  

At the same time, from a maintenance standpoint, I suppose you can go
overboard.

Signature

Regards,
Tom Ogilvy


> Greetings:
> I have a new module, consisting of many "subs"
[quoted text clipped - 6 lines]
>
> Thanks
Jim Thomlinson - 23 May 2006 22:01 GMT
To further what Tom has said, where you have a real need for speed
(performance is noticably poor) then keep function or procedure calls out of
large loops (a few thousand loops or more). There is overhead associated with
every call so if it is in a loop it can become significant. If it is just
regular sequential code then there really is no benefit to 'in lining" your
subs or functions, and maintenance will often be easier if you break your
code up into multiple subs or functions.
Signature

HTH...

Jim Thomlinson

> It takes longer to call a sub to execute some code than it does to execute it
> inline.
[quoted text clipped - 23 lines]
> >
> > Thanks
BEEJAY - 24 May 2006 12:42 GMT
Tom and Jim:
Thank You:  Gives me quite some peace of mind

> To further what Tom has said, where you have a real need for speed
> (performance is noticably poor) then keep function or procedure calls out of
[quoted text clipped - 31 lines]
> > >
> > > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.