Listvariable leeren!?!?!?
Timo
Hab mit folgendem Code eine Liste von Dateien eigelesen:
Code:
Private Sub CommandButton1_Click()
Dim Antwort
Dim Antwort2
If Quelle = "" Then
MsgBox ("Please enter the source directory!")
Else
Antwort = MsgBox(Quelle, 4, "Directory take over?")
If Antwort = vbYes Then
Dim Datei As String
Datei = Dir(Quelle & "\*.HIN")
Antwort = MsgBox(Datei, 4, "Is the designation of the files correctly called?") 'Ist die Bezeichnung der Dateien korrekt?
If Antwort = vbYes Then
Do While Datei <> ""
If Len(Datei) > 28 Then
MsgBox ("The file name " & Datei & " is too long! Filename correct?")
Exit Do
Else
If Len(Datei) < 28 Then
MsgBox ("The file name " & Datei & " is too short! Filename correct?")
Exit Do
Else
ReDim Preserve Liste(Z)
Liste(Z) = Datei
Z = Z + 1
Datei = Dir
If Z = 0 Then
MsgBox ("No files in the indicated directory!")
End If
End If
End If
Loop
If Z > 0 Then
Me.ComboBox1.List = Liste()
MsgBox (Z & " files were found!")
End If
End If
End If
End If
End Sub
Wie bekomme ich jetzt die Variable "Liste()" wieder geleert, sodass eine neue Dateiliste eingelesen werden kann?
Hoffe auf Hilfe!!!
Gruß Timo