Created
June 8, 2017 17:32
-
-
Save harsha547/1001fd563301662d0bc24eb9aec95982 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub GettingFile() | |
Dim SelectedFile As String | |
With Application.FileDialog(msoFileDialogFilePicker) | |
.AllowMultiSelect = False | |
.Title = "Select File" | |
.ButtonName = "Confirm" | |
.InitialFileName = "C:\" | |
If .show = -1 Then | |
SelectedFile = .SelectedItems(1) | |
MsgBox SelectedFile | |
Else | |
'Cancel Clicked | |
End If | |
End With | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment