I'm using FileDialog
with the msoFileDialogFolderPicker
option and what I want to do is to allow the user to browse for a zip file or a folder.
Is there any way to include zip files in this dialog and check if the clicked file is a .zip
file or a folder in Excel VBA?
This code only gets a folder:
Sub browseFolder()
Dim diaFolder As FileDialog
' Open the file dialog
Set diaFolder = Application.FileDialog(msoFileDialogFolderPicker)
diaFolder.AllowMultiSelect = False
diaFolder.Show
Sheet1.filePath.Value = diaFolder.SelectedItems(1)
End Sub