Hi,
In Excel VBA, I use the following code to show the FileDialog box and select a new folder:
Private Sub CommandButton1_Click()
With Application.FileDialog(msoFileDialogFolderPicker)
.InitialFileName = ThisWorkbook.Path
.Show
TextBox1 = .SelectedItems(1)
End With
End Sub
After the dialog box appears, if, however, I change mind and don't want to select a new folder and click the OK button or Cancel button, an error will pop up: "Path does not exist....". Any thing I am doing wrong?
Thank you in advance.
Bookmarks