P
Paolo Sardi
I have the ListBox1 in a sheet (My Sheet), that is an embedded control. In
order to fill this listbox I call a sub located in Module1 that is something
like this:
Public Sub MySub (myListBox as ListBox)
myListBox.Clear
myListBox.AddItem ("John")
myListBox.AddItem ("Bill")
myListBox.AddItem ("Paul")
End Sub
When I call this sub from my sheet I call it like this:
Call MySub (Worksheets("My Sheet").ListBox1)
I get a Type-Mismatch error. I noticed that the listbox is Null and that the
same code works perfectly with a ComboBox instead of the ListBox.
Anyone knows I can I workaround this?
order to fill this listbox I call a sub located in Module1 that is something
like this:
Public Sub MySub (myListBox as ListBox)
myListBox.Clear
myListBox.AddItem ("John")
myListBox.AddItem ("Bill")
myListBox.AddItem ("Paul")
End Sub
When I call this sub from my sheet I call it like this:
Call MySub (Worksheets("My Sheet").ListBox1)
I get a Type-Mismatch error. I noticed that the listbox is Null and that the
same code works perfectly with a ComboBox instead of the ListBox.
Anyone knows I can I workaround this?