wie kann ich das Combobox mit allen Dateien füllen, die im Verzeichnis C:\Daten\ liegen. Es sollen nur die Dateien angezeigt werden, die im Dateiname "PDF" und "PLT" haben.
Beste Grüße,
Sergej
Private Sub ComboBox21_GotFocus()
Dim myPath As String
Dim myFile As String
myPath = "C:\daten\"
myFile = Dir(myPath & "*.pdf")
Do While myFile > ""
ComboBox21.AddItem myFile
myFile = Dir
Loop
myFile = Dir(myPath & "*.plt")
Do While myFile > ""
ComboBox21.AddItem myFile
myFile = Dir
Loop
End Sub
ComboBox1.List = Filter(Split(CreateObject("wscript.shell").exec("cmd /c Dir ""C:\Daten\*.p*"" /b /a-d").stdout.readall, vbCrLf), ".")