Had a problem today where I got a Type mismatch error when tying to pass a reference to Listbox object as a Sub parameter. I got round it by declaring the object as MSForms.Listbox instead of just plain Listbox.
e.g.The initial error must mean that there is Listbox class declared in another Library somewhere. I searched the object browser for Listbox and found the only one to be in MSForms. There are also an xlListBox and xlDialogListBoxProperties as class members within the Excel library.Code:Sub micListPre1(objListSelected As MSForms.Listbox)
Can anyone explain why I got the error in the first place? Beats me!


Reply With Quote