using this code returns 0 files found
from windows search the files are found...
I AM LOST IN THIS THING:mad:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column = 10 And Target.Row = 1 Then
Cancel = True
For Each c In Range("fnam")
fn = c.Value
FilePath = "C:\SC Engineering"
FileSpec = fn '& ".*"
MsgBox FileSpec
FilesFixed = 0
Set FS = Application.FileSearch
With FS
.NewSearch
.LookIn = FilePath
.FileName = FileSpec
.SearchSubFolders = True
.Execute
foundFileCount = .FoundFiles.Count
MsgBox .FoundFiles.Count
End With
If foundFileCount = 0 Then
MsgBox "No files found."
Exit Sub
End If
Next c
Else: Cancel = False
End If
End Sub
02-11-2008, 12:57 PM
Hack
Have you stepped through the code to see what it is actually doing?
02-11-2008, 01:03 PM
batman61
Reply
it says 0 files found
each msbox shows the steps it is just returning o files found
02-11-2008, 01:44 PM
Hack
No, I mean put a break at the beginning of the routine and step through the code execution using F8
02-11-2008, 01:47 PM
batman61
did that and it appears as if it is looking at a blank directory...
the code executes fine..I think there is something missing
I get no errors..
i use msgbox like debug.print
still lost