Lines in a Module(Procedure)

  • Thread starter Thread starter Juan Melero
  • Start date Start date
J

Juan Melero

I sometimes get a message that my procedure is too long.
How many lines of code does a procedure hold?
Thanks for the reply in advance.
 
How many lines are you dealing with? What is the exact message? Do you
know it verbatim? - Pikus
 
the rule of thumb around here is that procedures shouldn't be bigger than 64k
when you export it to a text file.

But that's just a rule of thumb. I don't think the actual limit is documented
anywhere.
 
I don't know what the exact message was but I know I had
alot of lines because what I did was record a macro in
Excel. I had a spreadsheet that is around 4 Pages long
and when I looked at the code it was huge. When I ran the
macro it gave me the message so I broke down the code into
sub procedures until I did not get the message anymore. I
was just wondering if it said an exact number somewhere.
You should try this to see if you can come up with the
exact number. My rule of thumb is not to write a
procedure that is longer than a page or page and 1/2.
 
the rule of thumb around here is that procedures shouldn't be bigger than 64k
when you export it to a text file.

But that's just a rule of thumb. I don't think the actual limit is documented
anywhere.
...

64KB in one module I can understand, but 64KB in one *procedure*? Even if lines
of code averaged 64 characters (including the ending newline sequence), that'd
be a 1024 line procedure, so spanning just a bit more than 17 60-line pages in
printout. A single prodedure of that size is a REALLY BAD IDEA!
 
Honestly I didn't even realize that. I was just joking about actuall
writing something that long in general. I mean it's not often that
write anything over three pages, much less anything that eve
approaches seventeen, so that's why it's funny for me to say I'll hav
to be careful not to write that much code. "OOPS! 17 pages of code!
Darnit!" - Pikus :
 
Back
Top