Fehlersuche
Max
Ich den Fehler bei nachfolgendem Code nicht?!?! Die Fehlermeldung lautet "Laufzeitfehler 1004 Anwendungs- oder objektdefinierter Fehler".
Könnt Ihr mir helfen? Ich habe die Zeile markiert.
DANKE!!!!
Sub GetAllFiles()
Dim arrFiles As Variant, arr As Variant, arrHeader As Variant
Dim iFile As Integer, iArr As Integer, iRow As Integer
Dim sTxt As String
Close
Cells.Clear
arrHeader = Array("Kontrollkästchen4", "Kontrollkästchen5", "Text1", "Text2", "Text3")
arrFiles = FileArray(ThisWorkbook.Path, "*.fdf")
If arrFiles(1) = False Then
Beep
MsgBox "Es wurden keine FDF-Dateien gefunden!"
Else
For iArr = 0 To UBound(arrHeader)
Cells(1, iArr + 1).Value = arrHeader(iArr)
Next iArr
iRow = 1
For iFile = 1 To UBound(arrFiles)
iRow = iRow + 1
Call GetText(ThisWorkbook.Path & "\" & arrFiles(iFile), sTxt)
arr = Split(sTxt, "/V")
For iArr = 1 To UBound(arr) - 1
arr(iArr) = Right(arr(iArr), Len(arr(iArr)) - 1)
arr(iArr) = Left(arr(iArr), InStr(arr(iArr), ">> FEHLER =>>>>>>> Cells(iRow, UBound(arr)).Value = arr(UBound(arr))
Next iFile
End If
End Sub