LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default FileSearch does not work, XP SVP1, Office 2002

I was testing the following filesearch in Excel by creating 3 text files in
the C:\ directory. I keep getting There were no files found. I tried this
on another computer and it worked fine. I tried the code in access, same
result.

Sub filesearchtest()


With Application.FileSearch
.NewSearch
.LookIn = "C:\"
.SearchSubFolders = False
.Filename = "*.txt"
.MatchTextExactly = False
'.FileType = msoFileTypeAllFiles
If .Execute() 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If

End With

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2002 to 2007 Macro containing "Filesearch" dede Setting up and Configuration of Excel 3 December 4th 09 05:00 PM
Trying to work with files copied from Office 2004 (MAC) in Office rgranell Excel Worksheet Functions 3 June 19th 08 04:31 PM
Unable to open Office 2007 files using Office 2002 XP GildaBB Excel Discussion (Misc queries) 2 July 20th 07 04:08 AM
FileSearch inconsistencies between Office/Windows version combinat Ali Campbell Excel Programming 5 July 8th 04 09:36 PM
Office automation application which will work with any version of office C#.NET Silly Programmer Excel Programming 1 February 21st 04 10:54 AM


All times are GMT +1. The time now is 09:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"