![]() |
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 |
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 |
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 . |
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 . |
FileSearch
I have. :(
"Dave Peterson" wrote in message ... Does changing this: .Filename = "*.xls" to .Filename = ".xls" help. By the way, there have been a few posts that say that .filesearch is flakey in xl2002. It sometimes doesn't find all the files. Although, I've never seen it miss all of them. wrote: 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 . -- Dave Peterson |
FileSearch
Hi Myrna:
Nice of you to drop by <g ... where have you been? -- Regards, Vasant. "Myrna Larson" wrote in message ... I have. :( "Dave Peterson" wrote in message ... Does changing this: .Filename = "*.xls" to .Filename = ".xls" help. By the way, there have been a few posts that say that .filesearch is flakey in xl2002. It sometimes doesn't find all the files. Although, I've never seen it miss all of them. wrote: 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 . -- Dave Peterson |
FileSearch
Hi Myrna
Do you know if there are problems in 2003 also ? -- Regards Ron de Bruin http://www.rondebruin.nl "Myrna Larson" wrote in message ... I have. :( "Dave Peterson" wrote in message ... Does changing this: .Filename = "*.xls" to .Filename = ".xls" help. By the way, there have been a few posts that say that .filesearch is flakey in xl2002. It sometimes doesn't find all the files. Although, I've never seen it miss all of them. wrote: 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 . -- Dave Peterson |
FileSearch
I clicked on that link that Norman Jones posted.
It brought back memories of a previous thread that may look familiar. <bg Myrna Larson wrote: I have. :( "Dave Peterson" wrote in message ... Does changing this: .Filename = "*.xls" to .Filename = ".xls" help. By the way, there have been a few posts that say that .filesearch is flakey in xl2002. It sometimes doesn't find all the files. Although, I've never seen it miss all of them. wrote: 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 . -- Dave Peterson -- Dave Peterson |
All times are GMT +1. The time now is 10:16 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com