Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Procedure Too Large" error message 1

Status
Not open for further replies.

LouLBI

Programmer
May 16, 2012
16
US
I created a file partially by recording, and since it was repetitive, I did some copy/paste with editing. It ended up about 18 pages long, but it wouldn't't execute, and gave an error message of "procedure too large". I can't find any obvious syntax errors, and I didn't know that there was a file size limit.
Thanks in advance for your suggestions.
Lou
 
please see this link for info:


seems you can;t have more than 64k compiled as a single statement

SOP as per the page would be to break it down into different chunks in private subs and then call each private sub from a master procedure (set the individual subs as private to stop them showing in the macro list)

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 


chances are that your procedure can and SHOULD be edited to remove MOST of the COPY/PASTED stuff and replace with one or more loops or other coding techniques.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
You do not state what application this was recorded in (not a bad idea to do so), but if it was Word ALL recorded macros use Selection, and often a massive amount of extraneous unused (default) parameters. I agree with Skip. It is very likely that judicious editing could reduce things a lot. That along with some "chunking" your code into manageable callable procedures.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top