[vba] GetFolder / FileDialog를 이용한 폴더 선택 대화상자 활용

하나를하더라도최선을 2020-02-03 12:22:38 42,566 0 0
Function GetFolder() As String
    Dim fldr As FileDialog
    Dim sItem As String
    Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
    With fldr
        .Title = "Select a Folder"
        .AllowMultiSelect = False
        .InitialFileName = Application.DefaultFilePath
        If .Show <> -1 Then GoTo NextCode
        sItem = .SelectedItems(1)
    End With
NextCode:
    GetFolder = sItem
    Set fldr = Nothing
End Function
 

댓글 0개

첫 번째 댓글을 작성해보세요!