"Out of memory" error with userform

Nav05

New Member
Joined
Aug 12, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I am creating a userform for my organization which has multipage controls on it, and many controls within each multipage. I had been working on getting the userform completed until I ran into an "Out of memory" error. This happens on a fresh restart of my computer and with no other programs running. I tried running the userform with and without the VBA code and the error still appears. The only thing I found was that if I deleted a certain number of multipage tabs, then the form will start running again, with or without the code. This has led me to think that perhaps too many controls are stopping the userform from running.

The most controls I've been able to run the userform successfully was 1809 (which I got from Me.Controls.Count). When I add the next page in (with about 30 controls), then the error appears. Any idea if there is a hard count on controls or how I can get around this error?

Thanks
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I get this problem with my userforms regularly - it's intensely frustrating. My userforms rarely have more than 10 controls on them, so I'm not sure that's the reason.

As an aside - I've never heard of userforms with that many controls... Have you looked into creating these controls dynamically? (ie. at runtime)
 
Upvote 0
I get this problem with my userforms regularly - it's intensely frustrating. My userforms rarely have more than 10 controls on them, so I'm not sure that's the reason.

As an aside - I've never heard of userforms with that many controls... Have you looked into creating these controls dynamically? (ie. at runtime)
Thanks for your response. I haven't heard of creating the controls dynamically, but I'll look into it now. I know I probably took the long way around it, but my form is setup like this:

The user has a number of selections for a number of fields on the first page (tab). Based on what selections they make, they have certain forms on the following pages to fill out. A different selection would bring up a different form. So what I did was code each of the forms into it then only show the one related to the selection they made.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top