I'm new to most of this so can anyone tell me what I am doing wrong? I get a Invalid Procedure Call or Argument when I change the .LookIn directory to something other than e:\drew
Thanks! Jason
Private Sub CommandButton1_Click()
Range("A2:C40000"
.Clear
r = 2
TheDate = Format(Now(), "mm/dd/yy"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Range("e1"
.Value = TheDate
Range("f1"
.Value = (Range("e1"
.Value) - 1
With Application.FileSearch
.NewSearch
.LookIn = "\\borg\HIX Docs\Beckwith\"
.FileName = "*.dwg"
.SearchSubFolders = True
If .Execute() > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
Else
MsgBox "There were no files found."
End If
For i = 1 To .FoundFiles.Count
Test = Format(FileDateTime(.FoundFiles(i)), "mm/dd/yy"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
If Test > Range("f1"
.Value Then
Cells(r, 1) = .FoundFiles(i)
Cells(r, 2) = FileLen(.FoundFiles(i))
Cells(r, 3) = Format(FileDateTime(.FoundFiles(i)), "mm/dd/yy"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
r = r + 1
End If
Next i
End With
End Sub
Thanks! Jason
Private Sub CommandButton1_Click()
Range("A2:C40000"
r = 2
TheDate = Format(Now(), "mm/dd/yy"
Range("e1"
Range("f1"
With Application.FileSearch
.NewSearch
.LookIn = "\\borg\HIX Docs\Beckwith\"
.FileName = "*.dwg"
.SearchSubFolders = True
If .Execute() > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
Else
MsgBox "There were no files found."
End If
For i = 1 To .FoundFiles.Count
Test = Format(FileDateTime(.FoundFiles(i)), "mm/dd/yy"
If Test > Range("f1"
Cells(r, 1) = .FoundFiles(i)
Cells(r, 2) = FileLen(.FoundFiles(i))
Cells(r, 3) = Format(FileDateTime(.FoundFiles(i)), "mm/dd/yy"
r = r + 1
End If
Next i
End With
End Sub