#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default FileSearch

I can't get FileSearch to return a correct file search.
Application.FileSearch.FoundFiles.Count is always zero.

Does the Application.FileSearch no longer work in Excel
VB 2002?


Tx,

Stephen
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default FileSearch

Stephen

Perhaps your search criterion(a) is/are not correct.

This works for me.

Sub file_find()
Set fs = Application.FileSearch
With fs
.lookin = "e:\program files\microsoft office\exceldata"
.Filename = "*.xls"
'or "*searchstring*"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
Else
MsgBox "There were no files found."
End If
End With
End Sub

Gord Dibben Excel MVP

On Fri, 11 Jun 2004 17:29:37 -0700, "Stephen"
wrote:

I can't get FileSearch to return a correct file search.
Application.FileSearch.FoundFiles.Count is always zero.

Does the Application.FileSearch no longer work in Excel
VB 2002?


Tx,

Stephen


  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default FileSearch

This works for me in Excel 97, but not in 2002 (SP2).
Any other ideas?


-----Original Message-----
Stephen

Perhaps your search criterion(a) is/are not correct.

This works for me.

Sub file_find()
Set fs = Application.FileSearch
With fs
.lookin = "e:\program files\microsoft

office\exceldata"
.Filename = "*.xls"
'or "*searchstring*"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
Else
MsgBox "There were no files found."
End If
End With
End Sub

Gord Dibben Excel MVP

On Fri, 11 Jun 2004 17:29:37 -0700, "Stephen"
wrote:

I can't get FileSearch to return a correct file

search.
Application.FileSearch.FoundFiles.Count is always zero.

Does the Application.FileSearch no longer work in Excel
VB 2002?


Tx,

Stephen


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default FileSearch

Hi Stephen,

Look at this thread:

http://tinyurl.com/3gwog


---
Regards,
Norman


wrote in message
...
This works for me in Excel 97, but not in 2002 (SP2).
Any other ideas?


-----Original Message-----
Stephen

Perhaps your search criterion(a) is/are not correct.

This works for me.

Sub file_find()
Set fs = Application.FileSearch
With fs
.lookin = "e:\program files\microsoft

office\exceldata"
.Filename = "*.xls"
'or "*searchstring*"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
Else
MsgBox "There were no files found."
End If
End With
End Sub

Gord Dibben Excel MVP

On Fri, 11 Jun 2004 17:29:37 -0700, "Stephen"
wrote:

I can't get FileSearch to return a correct file

search.
Application.FileSearch.FoundFiles.Count is always zero.

Does the Application.FileSearch no longer work in Excel
VB 2002?


Tx,

Stephen


.



Reply
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 a combo box michaelberrier Excel Discussion (Misc queries) 0 June 16th 06 12:21 AM
FileSearch using VBA Mark[_31_] Excel Programming 2 December 24th 03 05:49 PM
FileSearch Problem Jarek[_3_] Excel Programming 3 November 27th 03 02:06 PM
.FileSearch Randall[_3_] Excel Programming 4 November 26th 03 01:48 AM
FileSearch Code Pedro[_4_] Excel Programming 1 August 6th 03 02:27 PM


All times are GMT +1. The time now is 02:07 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"