-
If you explicitly refer to the listbox, it seems to work fine[VBA]Me.List1.AddItem SheetList(i)[/VBA]Is there any particular reason you create a collection?[VBA]Private Sub CommandButton1_Click()
Dim FName As String
Dim ws As Worksheet
Dim Wkb As Workbook
Application.EnableEvents = False
Application.ScreenUpdating = False
Application.DisplayAlerts = False
FName = Application.GetOpenFilename("Excel Files (*.xls),*.xls")
If FName <> "False" Then
Set Wkb = Workbooks.Open(Filename:=FName)
End If
For Each ws In Wkb.Worksheets
Me.List1.AddItem (ws.Name)
Next
Wkb.Close SaveChanges:=False
Application.EnableEvents = True
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Set Wkb = Nothing
End Sub[/VBA]
K :-)

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules