If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > application.filesearch keep looking for old file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-27-03, 06:17
kmr_ashutosh kmr_ashutosh is offline
Registered User
 
Join Date: Dec 2003
Posts: 2
application.filesearch keep looking for old file

When I first time execute application.filesearch it seeks correctly. but on latter searches it uses prebuilt index and keep looking in that path.even though I have moved file to inner directory. I have to leave the program for 15-20 mins then perhaps it clears it cache and works. I am not getting how to clear its cache. code is like this.pls help

With Application.FileSearch
.NewSearch
.LookIn = PerformanceBook.Path
.SearchSubFolders = True
.Filename = "omsTimes.csv"
.FileType = msoFileTypeAllFiles
If (.Execute(SortBy:=msoSortByLastModified, SortOrder:=msoSortOrderAscending, AlwaysAccurate:=True) <> 0) Then
Reply With Quote
  #2 (permalink)  
Old 12-27-03, 08:24
RickKnight RickKnight is offline
Registered User
 
Join Date: Sep 2003
Location: Cincinnati, Oh USA
Posts: 203
Re: application.filesearch keep looking for old file

Appears to me that your not defining you path statement. The "lookin"
statement should be something like .LookIn = "C:\My Documents".

Quote:
Originally posted by kmr_ashutosh
When I first time execute application.filesearch it seeks correctly. but on latter searches it uses prebuilt index and keep looking in that path.even though I have moved file to inner directory. I have to leave the program for 15-20 mins then perhaps it clears it cache and works. I am not getting how to clear its cache. code is like this.pls help

With Application.FileSearch
.NewSearch
.LookIn = PerformanceBook.Path
.SearchSubFolders = True
.Filename = "omsTimes.csv"
.FileType = msoFileTypeAllFiles
If (.Execute(SortBy:=msoSortByLastModified, SortOrder:=msoSortOrderAscending, AlwaysAccurate:=True) <> 0) Then
__________________
Rick Knight
KnightShift Office Solutions and Horse Breaking
VB, VBA, FileMaker, Access Solutions, Web Solutions
Reply With Quote
  #3 (permalink)  
Old 12-28-03, 06:09
kmr_ashutosh kmr_ashutosh is offline
Registered User
 
Join Date: Dec 2003
Posts: 2
application.fileserch

I ahve used .lookin . But I am facing this problems

when I move files to inner directory and then run my application.filesearch it still keeps tells location of files as previous one. If I restart the machine and leave it for half an hour then it tells correct location of files. It keeps the result cached and some how I have to clear it.

With Application.FileSearch
.NewSearch
.FileType = msoFileTypeAllFiles
.LookIn = PerformanceBook.Path
.SearchSubFolders = True
.Filename = "omsTimes.csv"
If (.Execute(SortBy:=msoSortByLastModified, SortOrder:=msoSortOrderAscending) <> 0) Then

fcount = .FoundFiles.count
For count = 1 To .FoundFiles.count
allcsvfiles(count) = .FoundFiles.Item(count)
Next count
End If
End With
Reply With Quote
  #4 (permalink)  
Old 08-06-07, 21:44
MikeFalkner MikeFalkner is offline
Registered User
 
Join Date: Aug 2007
Posts: 1
Indexing Service (cache) was my problem

Regarding your message left on dbforums.com about FileSearch keeping old files in some type of cache, I found that I had the same problem until I turned off indexing service with my "Search Companion" in Windows Explorer. Then the following lines worked.

With Application.FileSearch
.NewSearch
.FileName = "*.txt"
.LookIn = xPath
.Execute
xTotalFiles = .FoundFiles.Count
End With

For i = 1 To xTotalFiles
.
.
.
Next i

Hope this helps.
Reply With Quote
  #5 (permalink)  
Old 01-28-10, 05:18
JimCosser JimCosser is offline
Registered User
 
Join Date: Jan 2010
Posts: 1
Thumbs up Brilliant

Nice one, Turning off the indexing service solved my issues. Found this page with a quick google so many thanks Mike.

Jim
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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