ich habe beim Versuch das Vorhandensein einer Datei das Problem, dass vorhandene Files nicht erkannt werden. Es handelt sich um *.dtxt-Files aus einer Excel-Applikation heraus gesucht werden sollen. Der Code sieht folgendermassen aus:
Sub fehlende_Quellsheets_eruieren()
Dim fso
Dim file As String
x = 3
Do Until IsEmpty(Cells(x, 3).Value)
Cells(x, 3).Activate
file = "C:\Quellsheets\" & "*" & ActiveCell.Value & "*" & ".dtxt"
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists(file) Then
MsgBox file & " was not located.", vbInformation, "File Not Found"
x = x + 1
Else
MsgBox file & " has been located.", vbInformation, "File Found"
x = x + 1
End If
Loop
End Sub
In der MsgBox steht dann folgende Antwort:
C:\Quellsheets\*123456*.dtxt was not located
Weiss jemand woran das liegt?
Besten Dank im voraus
Nero XXII