I'm trying to fill a listbox in Excel VBA and then after select some itens exclude then from the list. But I keep getting the error '-2147467259 (80004005)'.
I code the following:
Private Sub CommandButton1_Click()
ListBox1.ColumnCount = 1
ListBox1.RowSource = "Planilha1!B3:B11"
ListBox1.Font.Size = 10
ListBox1.Font.Name = "Verdana"
End Sub
Private Sub CommandButton3_Click()
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
ListBox1.RemoveItem (i)
End If
Next
End Sub

RowSourceor flexibilize the listbox contents by separating them from your row source.