sujittalukde
Well-known Member
- Joined
- Jun 2, 2007
- Messages
- 520
I am using the following code to select the folder path:
The code has two pitfalls which I need to fix:
1. If the "Cancel" button is cancelled, then also it is giving the path.
2. I want that user must select a folder ie this code gives output if onlu Drive is selected as C:\. I want that if only drive is selected then it should give a message that only drive is selected and must select o folder.
How can I do so?
Code:
Sub x()
Dim xx
xx = Application.FileDialog(msoFileDialogFolderPicker).Show
MsgBox CurDir
End Sub
The code has two pitfalls which I need to fix:
1. If the "Cancel" button is cancelled, then also it is giving the path.
2. I want that user must select a folder ie this code gives output if onlu Drive is selected as C:\. I want that if only drive is selected then it should give a message that only drive is selected and must select o folder.
How can I do so?