Hi
I'd like to run code which opens a folder and only shows two specific file types (binary and xlsx files).
I've got the code below, but it only shows xlsx files when run.
Does anyone know why binary files are not shown, as well?
TIA
I'd like to run code which opens a folder and only shows two specific file types (binary and xlsx files).
I've got the code below, but it only shows xlsx files when run.
Does anyone know why binary files are not shown, as well?
TIA
Code:
Sub BinaryOrXls()
Dim fd As Office.FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
fd.InitialFileName = ThisWorkbook.Path
.Filters.Clear
.Filters.Add "Xlsx", "*.xlsx"
.Filters.Add "Xlsb", "*.xlsb"
If .Show = True Then
txtFileName = .SelectedItems(1)
Label1.Caption = txtFileName
End If
End With
End Sub