• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

Procedure Size

Is there a limit on how big a procedure can be? I keep getting an error that my procedure is too big...

Thanks,
KalluMama
0
KalluMama
Asked:
KalluMama
  • 2
1 Solution
 
jkaiosCommented:
Yes there is a limit on how big a procedure can be.  Comments in a procedure also count.

If you have too many lines of comments in your procedure, try shortening or cutting down some of them to be as short and meanful as possible.

Or try splitting your procedure into smaller, multiple subroutines.
0
 
KalluMamaAuthor Commented:
cool thanks...i never knew that...i will keep that in mind!!
0
 
jkaiosCommented:
The following is an excerpt from MSDN.

CAUSE
The maximum size of the internal code for an individual procedure in Visual Basic is 64K bytes. Microsoft Visual Basic for Windows uses Microsoft Visual Basic for Applications, which generates more generic internal code. This generic code allows for compatibility with a wider range of processors. This makes the internal code larger, so it can cause very large procedures to exceed the 64K limit and fail to compile.

WORKAROUND
Split the large procedure into two or more smaller procedures.

STATUS
This behavior is by design.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now