Gruppe
Dialog
Problem
Wie kann ich die Tabellenblätter eine geschlossenen Arbeitsmappe in eine ListBox einer UserForm einlesen?
ClassModule: frmTabellen
Sub cmdList_Click()
Dim wks As Worksheet
Dim vFile As Variant
Application.ScreenUpdating = False
Application.EnableEvents = False
On Error GoTo ERRORHANDLER
vFile = Application.GetOpenFilename("Excel-Arbeitsmappen (*.xls), *.xls")
If vFile = False Then Exit Sub
Workbooks.Open vFile
For Each wks In ActiveWorkbook.Worksheets
lstWks.AddItem wks.Name
Next wks
ActiveWorkbook.Close savechanges:=False
ERRORHANDLER:
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Private Sub cmdContinue_Click()
Unload Me
End Sub
StandardModule: basMain
Sub CallForm()
frmTabellen.Show
End Sub