Hi, I wonder whether someone could help me please.
I'm trying to use the code below to open a specific file type, in this case '.dat'.
Code
Sub btnFetchFiles()
Dim file As String
iRow = 7
fPath = "\\c\s\CAF2\SA\Accessibility\Dragon - Application-Specific Script Conversion 2014\Converted Scripts\Done\"
file = Dir(fPath & "*.dat")
If file <> "" Then
Set FSO = New Scripting.FileSystemObject
If FSO.FolderExists(file) <> False Then
Set SourceFolder = FSO.GetFolder(file)
IsSubFolder = True
Call ListFilesInFolder(SourceFolder, IsSubFolder)
Call ResultSorting(xlAscending, "C7")
Else
MsgBox "Selected Path Does Not Exist !!" & vbNewLine & vbNewLine & "Select Correct One and Try Again !!", vbInformation, "File Manager - http://www.LearnExcelMacro.Com"
End If
End If
End Sub
Display More
The problem I have is that although the script runs, it's showing all the file types rather than the '.dat' files I want to show.
Could someone perhaps tell me where I've gone wrong.
Many thanks and kind regards
Chris