Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default Compile Error: Procedure too large

I have one macro which has 1818 lines and there is no error, another
which is 117 and I get "Compile Error: Procedure too large".

How can this be?

As soon as I run the macro the error is shown?

Thanks (haven't posted code as I think its a quantity thing).
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Compile Error: Procedure too large

Hi Simon,

Is this a sub in a Useform module or code that is called from a sub in a
userform module? I have often had strange problems with code error handling
with subs either in or called from Userform modules. Some problems
experienced are.

Total freeze of Excel.
Ignores the code and just doesn't run.
Error messages that don't match the real error.

Firstly, are you compiling the code before attempting to run it? If not try
menu item Debug - Compile. Sometimes this will highlight code errors that
cause problems like you are having.

Next:
What I have sometimes had to do is remove the code from the Userform module
and place it in a standard module. Replace all references to Me. with the
Userform's name. (Or, if Me. was not used because mostly it is not required
when in the Userform's module, insert the userforms name for all userform
controls etc .)

Attempt to compile the code and fix any compile errors.

When you show the form, show it as modeless so that you can get back to the
VBA editor to run the code directly from the standard module without a call
from a from a form control. Then run the code from the editor and it will
usually stop on the real errors. Once the real errors are fixed, it can
usually be put back into the Userform's module.

However, having said to show the form as modeless, you can't do that if you
are using RefEdit controls (controls where you can select a worksheet range)
on the form because they do not work in Modeless forms. If you do not enter
the ?RefEdit control no problem but if you do then Excel freezes.

If the above does not work or the code is already in a standard module, try
making a copy of the workbook and remove the code that you say is working and
just leave the failing code and see if it will compile run.


--
Regards,

OssieMac


"Simon" wrote:

I have one macro which has 1818 lines and there is no error, another
which is 117 and I get "Compile Error: Procedure too large".

How can this be?

As soon as I run the macro the error is shown?

Thanks (haven't posted code as I think its a quantity thing).
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile Error - Procedure too large DAVEYB Excel Programming 7 September 1st 08 09:41 PM
VBA Compile error: Procedure too large? Jerry Dyben Excel Discussion (Misc queries) 1 October 31st 05 10:15 PM
Compile error: Procedure too large BHARATH RAJAMANI Excel Programming 2 August 24th 05 10:24 PM
Compile error: Procedure too large Susan Hayes Excel Programming 2 May 20th 05 05:01 PM
Compile Error: Procedure too large mate Excel Programming 2 May 18th 04 04:30 PM


All times are GMT +1. The time now is 05:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"