Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Application.FileSearch
This function works on some WinXP Pro, Excel 2002
installations, but not on others. The function is adapted from the example in Microsoft Knowledge Base Article - 210613 Function LocateFile(strFileName As String) Dim vItem As Variant With Application.FileSearch .Filename = strFileName .LookIn = "C:\" .SearchSubFolders = True .Execute Debug.Print .FoundFiles.Count For Each vItem In .FoundFiles Debug.Print vItem Next vItem End With Debug.Print "Done" End Function It should print out all locations of the file given as an argument. Here is a printout from the Immediate window, showing that on my machine, Application.FileSearch fails to find any files: LocateFile "AUTOEXEC.BAT" 0 Done Why does this function fail on my machine, but work on Win98, WinME, and WinXP Home machines? Is it a security issue similar to the one reported in the Knowledge Base about using JET to execute FileSearch? Thanks for any responses. -Roger |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Application.FileSearch | Excel Discussion (Misc queries) | |||
macro to close excel application other than application.quit | Excel Programming | |||
EXCEL FILESEARCH | Excel Programming | |||
FileSearch using VBA | Excel Programming | |||
.FileSearch | Excel Programming |