Поиск

Диалог открытия файла(ов) Excel

Dim thisB As Workbook
Set thisB = ActiveWorkbook
PS = Application.PathSeparator
With Application.FileDialog(msoFileDialogFilePicker)
       .InitialFileName = thisB.Path & PS 
       .AllowMultiSelect = False
       .ButtonName = "OK"
       .Filters.Clear
       .Filters.Add Description:="Файлы Microsoft Excel", _
            Extensions:="*.xls; *.xlsx; *.xlsm"
       If .Show = 0 Then
            Exit Sub
       End If
       myPath = .SelectedItems(1)
End With