I'am using the code below to choose a folder.
The dialog box opens in the strStartDir (R:\testdir\test).
Now it is not possible to go back to a higher folder or drive.
Can someone edit this code so I can select another drive ?
The dialog box opens in the strStartDir (R:\testdir\test).
Now it is not possible to go back to a higher folder or drive.
Can someone edit this code so I can select another drive ?
Code:
Public Function PickFolder(strStartDir As Variant) As String
Dim SA As Object, f As Object
Set SA = CreateObject("Shell.Application")
Set f = SA.BrowseForFolder(0, "Choose a folder", 16 + 32 + 64, strStartDir)
If (Not f Is Nothing) Then
PickFolder = f.Items.Item.Path
End If
Set f = Nothing
Set SA = Nothing
End Function