Excel vba procedure too large что делать

Обновлено: 19.05.2024

I received this error message - Procedure too large - in VBA. What is the reason and way out for this error?

164k 53 53 gold badges 247 247 silver badges 304 304 bronze badges 191 1 1 gold badge 1 1 silver badge 4 4 bronze badges

8 Answers 8

You probably have one or more gigantic procedures/functions and I think VBA 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:

You'd have something like:

52.4k 14 14 gold badges 89 89 silver badges 113 113 bronze badges

Your compiled procedure cannot exceed 64kb. You should break it up into different sub routines.


1,956 1 1 gold badge 14 14 silver badges 12 12 bronze badges

You might get this error message if the macro has been created using the 64-bit version of Office. See the following article for further details and a workaround:

164k 53 53 gold badges 247 247 silver badges 304 304 bronze badges

The idea of GiantProcedure didn't work for me, using Microsoft Powerpoint 2013. Then I added a "call" before each "proc". Like this:

Not sure why the top voted post is recommended as the giant procedure code didn't work for me either. What did end up working was this:

The Call statement pulled each of the subs as long as I called the correct named sub.

Agreed, procedures should be split into smaller subs instead of one gigantic piece of code.

I have seen the Procedure too large errors on 32 bit installations of Excel, when they run / compile perfectly fine on the 64 bit installation the code was written on - so if it is a case of Procedure too large error [suddenly] occurring and it used to work before, check if the Excel installation you are trying to run the code on is 32 bit, and try on a 64 bit installation instead.

My employees get the same message on their weaker computers, but I don't on mine. So it's either the fact that the memory on your computer is less than 16GB or otherwise it's the fact that you have an intel processor that's too weak. An i7 intel processor that's after the 8th generation should definitely get the job done. Just get a better computer processor and better memory on your computer and it will work.


Use a 32-bit version of an Office 2010 program Or Divide the module into parts

Читайте также: