ユーザーフォームにリストボックスを追加しました。コードを使用してプロパティを設定したり、アイテムを追加したりすると、リストボックスに何も表示されません。エラーは発生しません。リストボックスは空白のままです。ここにスニペットがあります。リストボックスのプロパティを確認したところ、Enabled と Visible は true、Locked は false です。
Private Sub Refresh_Click()
ListBox1.Clear
Dim wb As Workbook
UserForm1.ListBox1.BackColor = RGB(5, 5, 5) 'threw this in for testing; box not changed
For Each wb In Workbooks
MsgBox wb.Name
ListBox1.AddItem wb.Name
'this is what I'm trying to accomplish;
'wb.Name shows in the MsgBox but not in the listbox
Next wb
End Sub