Solved

Procedure Too Large -- But Only In Debug Mode

Posted on 2006-07-05
10
487 Views
Last Modified: 2008-02-01
I have some legacy code that compiles fine. However, when I run it in debug mode, this one function stops with "procedure too large". Is there something easy that I can set/fix? Changing this code to reduce code might be a pain.
0
Comment
Question by:GivenRandy
  • 3
  • 3
  • 3
  • +1
10 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 17043639
Hmm, never seen that one before. Any chance you can break the procedure down into smaller sub routines ?
0
 
LVL 9

Author Comment

by:GivenRandy
ID: 17043666
Yeah, but I'd rather not (has to go through a lot of testing, etc.). Was hoping there was something "strange", like some setting. If not, will have to modify the code. :(
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 17043678
Just out of curiosity, how long is your procedure ?
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17043768
Why dont u break it up into smaller procedures?
Just a work around suggestion


sub Proc1
   'do some stuff

    'Call another procedure to continue
    Proc2
end sub

sub Proc2
   'do some stuff

    'Call another procedure to continue
    Proc3
end sub

etc

0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17043793
checking the net, I found one site that says

if this is a treeview programme, then you can list a long segment under a separate procedure and call this procedure in the main programme.
i have done this and it works smoothly.



0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 9

Author Comment

by:GivenRandy
ID: 17044311
>Just out of curiosity, how long is your procedure ?

4,626 lines
122,146 characters (not counting whitespace)
201,639 characters (counting whitespace)
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 17044351
wow, thats one big procedure. Apparently the max size for a procedure is 64K:

    http://www.aivosto.com/vbwatch/help/faq.htm
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 17044470
I think that means you have no choice but to break the procedure up into three parts...
0
 
LVL 9

Author Comment

by:GivenRandy
ID: 17044763
Yep, I was afraid of that. It's going to be a pain.
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17045548
Will it be that bad?

The workaround I gave, which is what u are look like your doing now anyway
If u make those variables in that procedure globals to that mod
it may work, no?

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now