본문 바로가기
개발자 커뮤니티에 오신 것을 환영합니다!

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

페이지 정보

profile_image
작성자 하나를하더라도최선을
댓글 0건 조회 36,545회 작성일 20-02-03 12:22

본문

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
 

댓글목록

등록된 댓글이 없습니다.


Copyright © program1472 | IT HUB. All rights reserved.