vba userform causes excel to crash

acc5149

New Member
Joined
Oct 28, 2014
Messages
26
I'm having a very weird error occur with a userform causing excel to crash.

A little background, I'm working on a large project that has multiple goals with varying data entry points. I have a macro command button on the first worksheet which opens the intro user form. This intro userform lays out all the goals, then has command buttons which bring you to each specific goal, 7 in all. For goal 5, I have a very large userform with about 250 checkboxes. This form crashes excel upon opening if you go directly to it from the intro form when initially opening the workbook. However, if you go to any other goal first, then back out to the intro form, THEN go to this large goal 5 form, it opens without any error. Additionally, if you open the intro form by clicking the macro, then immediately close it and reopen it, you can go directly to goal 5 again without error.

This is also an error that only recently started occurring, as there was no problem opening this form before. Even still, there is only one instance in which this form causes excel to crash, and that is when you open the workbook, open the intro form, and navigate directly to this userform. Any other combination of steps allows this form to open without problem.

Could anyone help with this odd error?

Thanks!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Sorry, it actually does crash if you open the intro form, close it, and immediately reopen it and navigate to the form that causes the crash.

Navigating to another form first then returning to the intro form allows you to navigate to this form causing the crash without error. Once you get to the form without crashing, you can close the userform completely and restart from the intro page and it won't crash again, even when navigating directly to it. This process resets once you close the workbook and reopen it.
 
Last edited:
Upvote 0
Actually, there's pretty much no rhyme or reason to it. Sometimes it works, sometimes it crashes. Very frustrating. I think it might be the memory capacity of the computer I'm running it on. I also added this code after form.show in the command button sub, and it seems to be a little more consistent:

frm.Show
Application.ScreenUpdating = False

Let me know if this was a good solution. Thanks.
 
Upvote 0

Forum statistics

Threads
1,215,370
Messages
6,124,526
Members
449,169
Latest member
mm424

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