Opening userform

BPNuyttens

New Member
Joined
Oct 21, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I've been working with an Excel containing several userforms. Data entered in the userform is saved in a specific Excel tab when the userform is closed and the saved data reloads to the userform when the userform is opened. This Excel contains 6 of these userforms.
I have been doing some updates to the userforms and underlying codes recently but for an unknown reason one of the userforms does not open anymore when clicking on the respective button in Excel (see error message below).

1729524011277.png


When I click the "debug" button it's clear that the error occurs when opening the form and not at any later stage (uploading data into form).

1729524191238.png


The error message does not appear in the original Excel I have been using for over two years but it now suddenly appears upon changing some code in userforms that are even not related to the one I want to open here 'frmValidation". So when I change code of other userforms in the same Excel this one suddenly doesn't open anymore.

Anyone encountered the same or similar problem?
All help/suggestions are very welcome!

Thank you.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi and welcome to MrExcel !


Check that in the frmValidation you actually have a Multipage control.

Comment the multipage line and try again:
VBA Code:
Sub Open_frmValidation()
  With frmValidation
    .Width = 845
    .Height = 596
    '.MultiPage1.Value = 0
    .Show
  End With
End Sub

🧙‍♂️
 
Upvote 0
Hi and welcome to MrExcel !


Check that in the frmValidation you actually have a Multipage control.

Comment the multipage line and try again:
VBA Code:
Sub Open_frmValidation()
  With frmValidation
    .Width = 845
    .Height = 596
    '.MultiPage1.Value = 0
    .Show
  End With
End Sub

🧙‍♂️
Hi, thank you for your suggestion.
I tried but this doesn't help, I do have multiple pages in this userform.
Error message stays the same...
 
Upvote 0
Error message stays the same...
So the problem is in the code that is inside the userform.
Run the macro Open_frmValidation in Debug mode, pressing the F8 key, so that you enter the userform and see which line within the userform you have the error on.

Also put all your user form code here to review.
 
Upvote 0
If you work with forms a lot (or other classes) I suggest you open the VB Editor, click Tools-Options and then make sure this option is checked:

1729609558051.png


That will help to make the debugger stop on the actual offending code in your form, not just on the line that loads it.
 
Upvote 0

Forum statistics

Threads
1,223,865
Messages
6,175,058
Members
452,610
Latest member
Sherijoe

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