M
Mahmut
After I click the excel file, I want to search a specific text file in
a specific folder. If the text file is not in that folder, I want
workbook to close. I tried below, but it did not work.
Private Sub Workbook_Open()
............
With Application.FileSearch
.NewSearch
.LookIn = Filename
.SearchSubFolders = False
.TextOrProperty = "tftougpq"
.FileType = msoFileTypeAllFiles
If .Execute > 0 Then
ThisWorkbook.Close
End If
End With
......
......
End Sub
a specific folder. If the text file is not in that folder, I want
workbook to close. I tried below, but it did not work.
Private Sub Workbook_Open()
............
With Application.FileSearch
.NewSearch
.LookIn = Filename
.SearchSubFolders = False
.TextOrProperty = "tftougpq"
.FileType = msoFileTypeAllFiles
If .Execute > 0 Then
ThisWorkbook.Close
End If
End With
......
......
End Sub