pc-news
Goto Top

Ersatz für With Application.FileSearch in Excel 2010

Hallo,

habe in einer Excel Mappe folgendes VBA Script:

Private Function isFileAvailable(filename As String) As Boolean
With Application.FileSearch
.NewSearch
.filename = Right(filename, Len(filename) - InStrRev(filename, "\"))
.LookIn = Left(filename, InStrRev(filename, "\"))
isFileAvailable = .Execute() > 0
End With

End Function

In Excel 2010 funktioniert leider "With Application.FileSearch" nicht mehr.

Kennt jemand eine Alternative?

Gruß
Yvonne

Content-Key: 189479

Url: https://administrator.de/contentid/189479

Printed on: April 16, 2024 at 22:04 o'clock

Member: bastla
bastla Aug 12, 2012, updated at Aug 13, 2012 at 06:37:32 (UTC)
Goto Top
Hallo pc-news!

Um das Vorhandensein einer Datei zu prüfen, sollte
Function isFileAvailable(filename As String) As Boolean
isFileAvailable = CreateObject("Scripting.FileSystemObject").FileExists(filename)  
End Function
genügen ...

Grüße
bastla
Member: pc-news
pc-news Aug 12, 2012 at 18:58:06 (UTC)
Goto Top
Hallo bastla,

vielen Dank für Deine Antwort. Hat mir super geholfen, genau das habe ich gesucht.

Grüße
pc-news