Modules and Memory

richardn

Registered User.
Local time
Today, 12:18
Joined
Nov 6, 2001
Messages
49
I am not shure what's better : more modules whit a few number of functions in each one , or less modules , and more functions in each module ?
When I call a procedure, the module is loaded into memory too. The space required depends on the module's size or is the same even if the module is empty ?
Thanks,
Richard
 
More modules with fewer functions. As you noticed, when you call a func/proc in a global module, the whole module is loaded up in memory. The part of the VBA code you called will then be interpreted and executed. The memory load is linked to the number of lines of code in your module (albeit most of all, of course, to the very content of the code you execute, ie varialbes used etc.)

However, I've heard that MANY modules may also cause problems. So I guess you have to try to find a sensible balance...
 
Last edited:

Users who are viewing this thread

Back
Top Bottom