Compile Error: Procedure too large

Discussion in 'AutoCAD' started by keithwaite, Jun 4, 2004.

  1. keithwaite

    keithwaite Guest

    When I compile my VBA I get a message box with the following:
    Microsoft Visual Basic
    Compile Error:
    Procedure too large

    I have 8230 lines of Code in the VBA routine. Is there a Limit to how many lines of code you have in a .DVB file?

    TIA,
    Keith
     
    keithwaite, Jun 4, 2004
    #1
  2. I think the limit you need to worry about is not the size of the DVB file,
    but the size of a single subroutine. A compiled subroutine needs to be <
    64K in size. Break your Sub into a couple of smaller Subs and you should be
    fine.

    James
     
    James Belshan, Jun 4, 2004
    #2
  3. keithwaite

    keithwaite Guest

    I broke them out into 4 different Functions and then called the 4 Functions from One Sub.

    Thanks,
    Keith
     
    keithwaite, Jun 5, 2004
    #3
  4. Try breaking them into different VBA modules.

    Regards,
    Maksim Sestic
     
    Maksim Sestic, Jun 5, 2004
    #4
  5. keithwaite

    wivory Guest

    I see you got it working but I just wanted to add my concurrence with James - it's the size of a single procedure that causes the compiler to complain.

    Regards

    Wayne Ivory
    IT Analyst Programmer
    Wespine Industries Pty Ltd
     
    wivory, Jun 8, 2004
    #5
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 (here). After that, you can post your question and our members will help you out.