Hello:
Is there a fix for this in Excel 2007?
Run-time error '445': Object doesn't support this action
Sub BatchProcess()
Dim FS As FileSearch
Dim FilePath As String, FileSpec As String
Dim i As Integer
' Specify path and file spec
FilePath = ThisWorkbook.Path & "\"
FileSpec = "text??.txt"
' Create a FileSearch object
Set FS = Application.FileSearch
With FS
.LookIn = FilePath
.FileName = FileSpec
.Execute
' Exit if no files are found
If .FoundFiles.Count = 0 Then
MsgBox "No files were found"
Exit Sub
End If
End With
' Loop through the files and process them
For i = 1 To FS.FoundFiles.Count
Call ProcessFiles(FS.FoundFiles(i))
Next i
End Sub
Is there a fix for this in Excel 2007?
Run-time error '445': Object doesn't support this action
Sub BatchProcess()
Dim FS As FileSearch
Dim FilePath As String, FileSpec As String
Dim i As Integer
' Specify path and file spec
FilePath = ThisWorkbook.Path & "\"
FileSpec = "text??.txt"
' Create a FileSearch object
Set FS = Application.FileSearch
With FS
.LookIn = FilePath
.FileName = FileSpec
.Execute
' Exit if no files are found
If .FoundFiles.Count = 0 Then
MsgBox "No files were found"
Exit Sub
End If
End With
' Loop through the files and process them
For i = 1 To FS.FoundFiles.Count
Call ProcessFiles(FS.FoundFiles(i))
Next i
End Sub