Hi fourm,

I am searching for a way to have excel identify ASCII files in a specified directory. I seem to be running in to problems telling the program to look for the file extension ".asc" because it is not a defined Microsoft object.

Here's the code i have been trying.

'Fill in the path\folder where the files are
'on your machine
MyPath = InputBox("Paste Address", "Directory Location")

'Add a slash at the end if the user forget it
If Right(MyPath, 1) <> "\" Then
MyPath = MyPath & "\"
End If

'If there are no ASC files in the folder exit the sub
FilesInPath = Dir(MyPath & "*.asc")
If FilesInPath = "" Then
MsgBox "No files found"
Exit Sub
End If
Thanks,


Dubbdan