DavW
Jul 15th, 2003, 06:46 AM
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. Sub micListPre1(objListSelected As MSForms.Listbox)
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.
Can anyone explain why I got the error in the first place? Beats me!
e.g. Sub micListPre1(objListSelected As MSForms.Listbox)
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.
Can anyone explain why I got the error in the first place? Beats me!