ich möchte in einer ComboBox das Verzeichnis z.b. C\Excel\Gertrud\*.* einlesen
geht das ?
Gruss Walter
Private Sub UserForm_Initialize()
Dim i As Long
With Application.FileSearch
.LookIn = "C:\Excel\Gertrud\"
.FileType = msoFileTypeAllFiles
.Execute
For i = 1 To .FoundFiles.Count
ComboBox1.AddItem .FoundFiles(i)
Next i
End With
End Sub
Sub testDialog()
strPfad = Application.GetOpenFilename( _
"Exceldateien (*.xls), *.xls, Alle Dateien (*.*), *.*", 1, _
"Exceldateien auswählen...", MultiSelect:=False)
MsgBox strPfad
ChDir "C:\Excel\Getrud"
strPfad = Application.GetOpenFilename( _
"Exceldateien (*.xls), *.xls, Alle Dateien (*.*), *.*", 1, _
"Exceldateien auswählen...", MultiSelect:=False)
MsgBox strPfad
End Sub
Sub testDialog()
Dim strPfad As String
ChDir "C:\Excel\Getrud"
strPfad = Application.GetOpenFilename( _
"Exceldateien (*.xls), *.xls, Alle Dateien (*.*), *.*", 1, _
"Exceldateien auswählen...", MultiSelect:=False)
If strPfad = "Falsch" or strPfad = "False" Then Exit Sub
Workbooks.Open FileName:=strPfad
End Sub
Sub testDialog()
Application.Dialogs(xlDialogOpen).Show
End Sub