반응형
Windows 탐색기를 열고 파일 선택
vba 양식에서 Windows 탐색기 창을 열고 특정 파일로 이동한 후 선택하여 파일 이름을 텍스트 상자에 넣을 수 있는 방법이 있습니까?
다음 스니펫을 확인하십시오.
Private Sub openDialog()
Dim fd As Office.FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.AllowMultiSelect = False
' Set the title of the dialog box.
.Title = "Please select the file."
' Clear out the current filters, and add our own.
.Filters.Clear
.Filters.Add "Excel 2003", "*.xls"
.Filters.Add "All Files", "*.*"
' Show the dialog box. If the .Show method returns True, the
' user picked at least one file. If the .Show method returns
' False, the user clicked Cancel.
If .Show = True Then
txtFileName = .SelectedItems(1) 'replace txtFileName with your textbox
End If
End With
End Sub
저는 이것이 당신이 요구하는 것이라고 생각합니다.
언급URL : https://stackoverflow.com/questions/10304989/open-windows-explorer-and-select-a-file
반응형
'programing' 카테고리의 다른 글
동일한 요소에서 *ngIf 및 *ngFor로 인해 오류 발생 (0) | 2023.04.26 |
---|---|
셸에서 배열의 길이를 찾는 방법은 무엇입니까? (0) | 2023.04.26 |
"실제" CultureInfo를 사용합니다.IetfLanguageTag의 CultureInfo가 아닌 WPF 바인딩의 현재 Culture (0) | 2023.04.26 |
메모리 스트림 - 닫힌 스트림에 액세스할 수 없음 (0) | 2023.04.26 |
앱이 포그라운드 iOS에 있는 동안 푸시 알림 받기 (0) | 2023.04.26 |