procedure too large

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
 
L

libby

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
 
R

Richard Choate

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
 
M

Myrna Larson

FWIW, the "pros" say that a single procedure should fit entirely on one screen, i.e. no more
than about 20 lines.
 
R

Richard Choate

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.
 
B

Bob Kilmer

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.
 
M

Myrna Larson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top