Hey, ich habe hier 2 fileexistschecks:
ZitatPublic Function fileexists(ByVal sFilename As String) As Boolean
Dim Fl As Integer: Fl = Len(Dir$(sFilename))
On Local Error Resume Next
fileexists = IIf(Err Or Fl = 0, False, True)
End Function
UND:
ZitatAlles anzeigenFunction fileexists(ByVal path As String) As Boolean
On Error GoTo fileexists_false
Dim X As Long
X = FreeFile
Open path$ For Input As X
fileexists = True
Close X
GoTo TheEnd:
fileexists_false:
fileexists = False
TheEnd:
End Function
Nun meine Frage:
Welcher von den ist sinnvoller/besser/bugfreier/whatever ??