What is the maximum number of controls that a VBA form can hold?

Posted by Lunatik on Stack Overflow See other posts from Stack Overflow or by Lunatik
Published on 2010-04-22T10:01:22Z Indexed on 2010/04/22 10:03 UTC
Read the original article Hit count: 232

Filed under:
|
|
|
|

I'm currently building an Excel 2003 app that requires a horribly complex form and am worried about limitations on the number of controls. It currently has 154 controls (counted using Me.Controls.Count - this should be accurate, right?) but is probably only about a third complete. The workflow really fits a single form, but I guess I can split it up if I really have to.

I see evidence in a Google search that VB6 (this usually includes VBA) has a hard limit of 254 controls in a form. However, I created a dummy form with well over 1200 controls which still loaded and appeared to work just fine.

I did get some 'out of memory' errors when trying to add specific combinations of controls though, say 800 buttons and 150 labels, leading me to think that any limit might be affected by the memory requirements of each type of control.

Does anyone have any information that might help ensure that I or, more importantly, other users with differing environments don't run into any memory issues with such a large form?

© Stack Overflow or respective owner

Related posts about excel-vba

Related posts about excel-2003