I have some code, that I got from this site, that allows a user to browse for a folder, the code is below. My question is, how do you determine whether the user has clicked the OK button, the Cancel button, or the close. "X" button?
Code:
fold = PickFolder(0)
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", 0)
If (Not F Is Nothing) Then
PickFolder = F.Items.Item.path
End If
Set F = Nothing
Set SA = Nothing
End Function