I am having trouble with ChDir.
The problem is that my search for 'Illegal' .xls, .doc and .pdf is not being conducted on my M drive but rather on my C drive. That is ChDir does not seem to be working.
Thanks
Rob
Code:
Sub FindFileNames()
Dim ParentName As String
Dim a As Double
Dim FilePath As String
Dim IllegalFileXls As String
Dim IllegalFileDoc As String
Dim IllegalFilePdf As String
For a = 0 To 81
ParentName = Cells(2 + a, 1)
FilePath = "M:\2 - Companies\Issuers\" & ParentName & ""
ChDir FilePath
IllegalFileXls = Dir("*.xls")
IllegalFileDoc = Dir("*.doc")
IllegalFilePdf = Dir("*.pdf")
Next a
End Sub
The problem is that my search for 'Illegal' .xls, .doc and .pdf is not being conducted on my M drive but rather on my C drive. That is ChDir does not seem to be working.
Thanks
Rob