Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileSearch does not work, XP SVP1, Office 2002
Hi wejones
Try it with .Filename = ".txt" If it is not working use Dir If you want a example post back -- Regards Ron de Bruin http://www.rondebruin.nl "wejones" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileSearch does not work, XP SVP1, Office 2002
FileSearch is problematic. It doesn't work for me, either; same program
versions that you are using. On Thu, 18 Nov 2004 11:09:55 -0800, "wejones" wrote: 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileSearch does not work, XP SVP1, Office 2002
Did not work. This seems to be a specific problem with Office 2002 on my
machine. I have uninstalled office, used the cleanup program and reinstalled it. But I still have the same problem. "Ron de Bruin" wrote: Hi wejones Try it with .Filename = ".txt" If it is not working use Dir If you want a example post back -- Regards Ron de Bruin http://www.rondebruin.nl "wejones" wrote in message ... 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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileSearch does not work, XP SVP1, Office 2002
Hi
I am running also Office 2002 and it is working for me, but there are problems with Application.FileSearch Like i said use Dir, this is always working Sub test() Dim txtcount As Long Dim TheFile As String Dim MyPath As String MyPath = "C:\" ChDir MyPath TheFile = Dir("*.txt") txtcount = 0 Do While TheFile < "" txtcount = txtcount + 1 TheFile = Dir Loop MsgBox txtcount End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "wejones" wrote in message ... Did not work. This seems to be a specific problem with Office 2002 on my machine. I have uninstalled office, used the cleanup program and reinstalled it. But I still have the same problem. "Ron de Bruin" wrote: Hi wejones Try it with .Filename = ".txt" If it is not working use Dir If you want a example post back -- Regards Ron de Bruin http://www.rondebruin.nl "wejones" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2002 to 2007 Macro containing "Filesearch" | Setting up and Configuration of Excel | |||
Trying to work with files copied from Office 2004 (MAC) in Office | Excel Worksheet Functions | |||
Unable to open Office 2007 files using Office 2002 XP | Excel Discussion (Misc queries) | |||
FileSearch inconsistencies between Office/Windows version combinat | Excel Programming | |||
Office automation application which will work with any version of office C#.NET | Excel Programming |