lior03
11-30-2005, 02:37 AM
hello
the enclose macro find file in a folder.
how do i make it open the files?
Sub findafile()
Dim i As Integer
Dim x As String
x = InputBox("select a file", "locate files")
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\user1\My Documents"
.FileType = msoFileTypeExcelWorkbooks
.FileName = x
.MatchAllWordForms = True
If .Execute > 0 Then
MsgBox "There were " & .FoundFiles.count & _
" file(s) found."
For i = 1 To .FoundFiles.count
MsgBox .FoundFiles(i), 32
Next i
Else
MsgBox "There were no files found."
End If
End With
End Sub
thanks
the enclose macro find file in a folder.
how do i make it open the files?
Sub findafile()
Dim i As Integer
Dim x As String
x = InputBox("select a file", "locate files")
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\user1\My Documents"
.FileType = msoFileTypeExcelWorkbooks
.FileName = x
.MatchAllWordForms = True
If .Execute > 0 Then
MsgBox "There were " & .FoundFiles.count & _
" file(s) found."
For i = 1 To .FoundFiles.count
MsgBox .FoundFiles(i), 32
Next i
Else
MsgBox "There were no files found."
End If
End With
End Sub
thanks