excel vba file search
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 '& ".*"
FilesFixed = 0
Set FS = Application.FileSearch
.LookIn = FilePath
.FileName = FileSpec
.SearchSubFolders = True
foundFileCount = .FoundFiles.Count
If foundFileCount = 0 Then
MsgBox "No files found."
Else: Cancel = False
Have you stepped through the code to see what it is actually doing?
it says 0 files found
each msbox shows the steps it is just returning o files found
No, I mean put a break at the beginning of the routine and step through the code execution using F8
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
What do you mean by "blank directory"?
Is the directory empty?