Type Mismatch: Unable to create Listbox in UserForm
Type Mismatch: Unable to create Listbox in UserForm
(OP)
Pulling my hair out here. It's a while since I did any VB and of course stuff has changed but.... I create a userform and add a listbox. A line of code in the initialize event adds one item for test purposes. I then create a module that loads and shows the form. Save the project, close it and reopen it and as soon as I run the macro I get Type Mismatch. This error also occurs sometimes when adding the listbox to the form in the first place. Buttons and labels are Ok but Listboxes, textboxes, combos etc all cause Type Mismatch. Any advice much appreciated.





RE: Type Mismatch: Unable to create Listbox in UserForm
RE: Type Mismatch: Unable to create Listbox in UserForm
Private Sub CommandButton1_Click()
Unload UserForm1
End Sub
Private Sub UserForm_Initialize()
Label1.Caption = "Hooray"
End Sub
And a Module linked to a button on a worksheet to show the userform, the code for which is
Sub showform()
Load UserForm1
UserForm1.Show
End Sub
This works fine but as soon as I try and drag another control such as a listbox or textbox onto the Userform from the toolbox I get a Type Mismatch error even before attempting to add any code or run it. I must be missing something obvious.