Compile Error Procedure Is Too Large
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more compile error procedure too large excel about Stack Overflow the company Business Learn more about hiring developers or posting
Excel Macro Compile Error Procedure Too Large
ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack
Compile Error Procedure Too Large Vba
Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Procedure Too Large up vote 12 down vote favorite 2 I
Compile Error In Hidden Module
received this error message -Procedure too large - in VBA. What is the reason and way out for this error? vba error-handling subroutine procedures share|improve this question edited Aug 28 '12 at 14:28 JackOrangeLantern 1,13811024 asked Sep 20 '10 at 12:01 Sourav 61114 add a comment| 3 Answers 3 active oldest votes up vote 15 down vote You probably have one or more gigantic procedures/functions and I think VBA compile error procedure too large vb6 has a limit of 64k or something per procedure. You fix it by splitting that procedure up into multiple procedures that can then be called by the one procedure. So instead of having: Sub GiantProcedure() ... ' lots and lots of code End Sub You'd have something like: Sub GiantProcedure() ... ' a little bit of common code Proc1() Proc2() Proc3() End Sub Sub Proc1() ... ' quite a bit of code End Sub Sub Proc2() ... ' quite a bit of code End Sub Sub Proc3() ... ' quite a bit of code End Sub share|improve this answer answered Sep 20 '10 at 12:07 Hans Olsson 38.5k96492 2 This error is straight out of the 1980's... VBA has reached a new level of archaic... face palm –Reverend_Dude Jul 29 '14 at 15:10 add a comment| up vote 5 down vote Your compiled procedure cannot exceed 64kb. You should break it up into different sub routines. http://msdn.microsoft.com/en-us/library/Aa264541 share|improve this answer answered Sep 20 '10 at 12:08 Wix 1,0121011 Or otherwise refactor the method. –Codes with Hammer Sep 8 '15 at 16:04 add a comment| up vote 1 down vote You might get this error message if the macro has been creat
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta procedure too large vb6 Discuss the workings and policies of this site About Us Learn more vba call a sub from another sub about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack subroutine vba Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping http://stackoverflow.com/questions/3751263/procedure-too-large each other. Join them; it only takes a minute: Sign up Excel VBA Script Compile Error “Procedure too Large” up vote 1 down vote favorite I've spent the whole night doing fruitless "NG" retakes of a long series of Excel VBA scripts, only to encounter repeated issues of Compile Error "Procedure too Large". As such, I would http://stackoverflow.com/questions/19664848/excel-vba-script-compile-error-procedure-too-large like to share my story and solution, and would also love to hear from you if you have any better ideas. excel vba compilation share|improve this question edited Aug 11 '15 at 14:42 Luuklag 1,231928 asked Oct 29 '13 at 17:11 Pageii Studio 304311 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted I debugged in Visual Basic, and found that by removing the following lines, the problem was resolved: ActiveWindow.ScrollRow = 10 ... ActiveWindow.ScrollRow = 10000 I realised that as my records had more than 10k rows, Macro also captures each of my mousescrolls or keyboard page-down scrolls as an additional macro command all by itself. As such, it choked up the memory limits for the macro due to multiple downward scrolls. So, the problem was resolved by simply deleting all the lines associated with "ActiveWindow.ScrollRow". I guess it would have helped if I had used a newer MS version or a more powerful Mac. Suggestions are welcome on how the Macro recording could
Tech Support Guy, we highly recommend that you visit our Guide for New Members. Solved: Excel Macros too large problem Discussion in 'Business Applications' started by theseus75, Jun 24, 2008. Thread Status: Not open for further replies. Advertisement theseus75 Thread Starter Joined: Jan 7, 2005 https://forums.techguy.org/threads/solved-excel-macros-too-large-problem.724207/ Messages: 275 I've recorded and combined a few macros into one and - while it is really large - I never thought anything of it until I got the following error while trying to run it: "Compile Error Procedure too large" I can certainly split these up into separate procedures, but it would save time to have them all as one. Is there a way to override this error? I am using Windows XP w/ SP2 and Excel 2003. Thanks in advance for any help. compile error theseus75, Jun 24, 2008 #1 OBP Trusted Advisor Joined: Mar 8, 2005 Messages: 19,068 It is probably quite possible that you can considerably reduce the size of the Macro by rewriting it. Recorded Macros are notorious for having superfluous code in them. If you post it I am sure that one of the Excel gurus can rewrite it for you, or at least point you in right direction. OBP, Jun 24, 2008 #2 Rollin_Again Joined: Sep 4, 2003 Messages: 4,865 Break the large macro compile error procedure into seperate subs and then call each of the separate subs from your main procedure. Doing it this way makes your code much easier to maintain and you can still execute all the code by running your main macro only. If you need more help please post your sample workbook or code and we'll take a look and offer more advice. Code: Sub MainMacro() Call Macro1 Call Macro2 Call Macro3 End Sub Sub Macro1() 'Your Code 'Your Code End Sub Sub Macro2() 'Your Code 'Your Code End Sub Sub Macro3() 'Your Code 'Your Code End Sub Regards, Rollin Rollin_Again, Jun 24, 2008 #3 theseus75 Thread Starter Joined: Jan 7, 2005 Messages: 275 Thanks for the help: that code worked perfectly, Rollin_Again. OBP: Yeah, I'm sure my code has plenty of little extras, but the Call method seemed to take care of it. One of these days I'll get around to cleaning them up a bit. Thanks again! theseus75, Jun 25, 2008 #4 This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue.View our Welcome Guide to learn how to use this site. Show Ignored Content As Seen On Welcome to Tech Support Guy! Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations. If you're not already familiar with forums, watch our Welcome Guide to get started. Join over 73