procedure too large

  • Thread starter Thread starter Ad van Zutphen
  • Start date Start date
A

Ad van Zutphen

I got following message after compiling in Excel97:

Procedure too large

64K seems to be the limit. Is there a way to bypass this,
without breaking up the macro?

Regards,

Ad
 
Yes 64K is the limit for a procedure.
You could try using more variables or splitting your code
into smaller procedures and calling them from each other
 
I had to break mine up. So do you. Misery loves company, and I really was
miserable when I had to break up that code. Sorry.
--
HTH
Richard Choate, CPA

I got following message after compiling in Excel97:

Procedure too large

64K seems to be the limit. Is there a way to bypass this,
without breaking up the macro?

Regards,

Ad
 
FWIW, the "pros" say that a single procedure should fit entirely on one screen, i.e. no more
than about 20 lines.
 
I don't think I could really agree with that. 20 lines is extremely short. I
try to have logical organization of code and I use lots of appropriately
named modules, too, but just try not to have so much you have to do a bunch
of scrolling. Also keep your lines short. Use lots of line breaks and good
comments.
--
HTH
Richard Choate, CPA

FWIW, the "pros" say that a single procedure should fit entirely on one
screen, i.e. no more
than about 20 lines.
 
I have heard the "screens worth of code per routine" thing too. It is a
rule-of-thumb - a good one, I think - to suggest when to re-examine the code
you are writing for modularity and cohesiveness. Personally, I find it falls
out of what I find works anyway, but I don't let a rule-of-thumb stand in
the way of good reason to do otherwise.
 
I agree with you on this one. If I have a procedure that fits on one screen, it usually just
calls other routines, never does "the work" itself.
 
Back
Top