+ Reply to Thread
Results 1 to 3 of 3

Procedure Too Large

  1. #1
    Registered User
    Join Date
    10-11-2007
    Posts
    14

    Procedure Too Large

    Hello Everyone,

    I am working on a workbook that does some reporting. I have one procedure that gathers all the data and smaller sub procedures. My large procedure (gatherData) is giving me the error ("Procedure too large"). I am deleting a lot of my comment lines because it's really hard for me to write the code (with less code) because it is basically a huge loop and i can't really break the loop up. So I was wondering, if I delete all my comments, do you think that would make my procedure smaller or does it mean actual lines of code that I need to delete?

    Thanks All.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello shassy,

    I am guessing this is a macro you recorded. The error refers to the physical size in bytes of the proceudre, so elminating comments would help. Chances are the code is bloated with Selects and Activates, etc. Post your code in the Programming forum and it can be streamlined. That way, it will run faster, take less space, and you can keep your comments.

    Sincerely,
    Leith Ross

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    There is a soft limit on the size of bas files of 64K each, beyond which things become increasingly unreliable. There's no reason for modules to approach that size, though. If any given procedure is more that a hundred lines or so, it usually should be broken up, and the separate procedures can go in separate modules.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1