A
Amanda
below is my code.
if i run it once, it works. if i run it twice, it does not. if i run
it the third time, it does.
obviously, something is ticking on and off.
any help would be great
thanks!
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\ga1790-1\Desktop
\Holder"
.Filename = "R2.xls"
If .Execute > 0 Then
For lCount = 1 To .FoundFiles.Count
Set wbresults =
Excel.Application.Workbooks.Open(Filename:=.FoundFiles(lCount),
UpdateLinks:=0)
Killer = .FoundFiles(lCount)
Killer = Split(Killer, "\")
Killer = Killer(UBound(Killer))
Workbooks(Killer).Close False
Kill .FoundFiles(lCount)
Next lCount
End If
End With
if i run it once, it works. if i run it twice, it does not. if i run
it the third time, it does.
obviously, something is ticking on and off.
any help would be great
thanks!
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\ga1790-1\Desktop
\Holder"
.Filename = "R2.xls"
If .Execute > 0 Then
For lCount = 1 To .FoundFiles.Count
Set wbresults =
Excel.Application.Workbooks.Open(Filename:=.FoundFiles(lCount),
UpdateLinks:=0)
Killer = .FoundFiles(lCount)
Killer = Split(Killer, "\")
Killer = Killer(UBound(Killer))
Workbooks(Killer).Close False
Kill .FoundFiles(lCount)
Next lCount
End If
End With