Application.Filesearch fails on WIN2K box

  • Thread starter Thread starter DRiggins
  • Start date Start date
D

DRiggins

The code below fails to find any Excel workbooks
(Application.FileSearch.FoundFiles.Count=0) when it is run
on a desktop with Windows 2000. However it works fine
when run on a WIN2K server.

I have confirmed that there are, in fact, Excel files on
the path that gets searched.

Any Ideas what is going on?

Dim FSearch As FileSearch
Set FSearch = Application.FileSearch

'** Get the path of the current database
TestPath = CurrentProject.Path
Fpath = FileSys.GetAbsolutePathName(TestPath)

'** Construct the paths for the incoming worksheets,
Filepath = Fpath & "\IncomingWorksheets\"
With FSearch
.LookIn = Filepath
.FileType = msoFileTypeExcelWorkbooks
If .Execute > 0 Then
 
DRiggins said:
The code below fails to find any Excel workbooks
(Application.FileSearch.FoundFiles.Count=0) when it is run
on a desktop with Windows 2000. However it works fine
when run on a WIN2K server.

I have confirmed that there are, in fact, Excel files on
the path that gets searched.

Any Ideas what is going on?

Dim FSearch As FileSearch
Set FSearch = Application.FileSearch

'** Get the path of the current database
TestPath = CurrentProject.Path
Fpath = FileSys.GetAbsolutePathName(TestPath)

'** Construct the paths for the incoming worksheets,
Filepath = Fpath & "\IncomingWorksheets\"
With FSearch
.LookIn = Filepath
.FileType = msoFileTypeExcelWorkbooks
If .Execute > 0 Then
.
.
.
End with

I have heard that the Indexing Service can interfere with the FileSearch
object. Try turning that off, or else use the Dir() function in a loop
to load your own array of files.
 
Back
Top