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 behaviour

FileSearch is producing duplicate results - listing the same file twice in
the FileSearch object. Additionally it's listing files outside the specified
"C:\" drive. Some are found in the E drive, which is a flash stick. Even
when this stick has been pulled out. Even when it's been pulled out
and the computer restarted! I guess the search results are stored
somewhere, but am clueless about the duplicates.

Kevin.

The code used:

Public Sub SearchForXLsheets()

Dim oFound As FileSearch
Dim l As Long

Set oFound = Application.FileSearch
With oFound
.NewSearch
.LookIn = "C:\"
.SearchSubFolders = True
.FileType = msoFileTypeExcelWorkbooks
.Execute SortBy:=msoSortByFileName
If .FoundFiles.Count 0 Then
For l = 1 To .FoundFiles.Count
Cells(l, 1).Value = .FoundFiles(l)
Next l
End If
Columns("A:A").EntireColumn.AutoFit
End With
Set oFound = Nothing

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
Filesearch in VB6 Colin Charman Excel Programming 3 June 18th 04 04:18 PM
FileSearch Stephen[_6_] Excel Programming 8 June 12th 04 11:14 PM
FileSearch using VBA Mark[_31_] Excel Programming 2 December 24th 03 05:49 PM
.FileSearch Randall[_3_] Excel Programming 4 November 26th 03 01:48 AM
FileSearch Problem Bin[_2_] Excel Programming 6 August 2nd 03 02:04 PM


All times are GMT +1. The time now is 10:58 PM.

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

About Us

"It's about Microsoft Excel"