Sub GetImportFileName() Dim Finfo As String Dim FilterIndex As Long Dim Title As String Dim FileName As Variant ' Set up list of file filters Finfo = "Excel Files (*.xlsx),*.xlsx" ' Display *.* by default FilterIndex = 5 ' Set the dialog box caption Title = "Escolhe caminho e ficheiro" 'Get the filename FileName = Application.GetOpenFilename(Finfo, _ FilterIndex, Title) ' Handle return info from dialog box If FileName = False Then MsgBox "Nenhum ficheiro foi escolhido." Else MsgBox "You selected " & FileName End If End Sub