Hi I have this code sample
This work correctly, It gives an error pressing cancel button..
I would like to valorize the variable even if CANCEL button is pressed to C: value
How can I do that?
Const MY_COMPUTER = &H11&
Const WINDOW_HANDLE = 0
Const OPTIONS = 0
Dim objShell
Dim objFolder
Dim objFolderItem
Dim strPath
Dim objPath
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(MY_COMPUTER)
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder _
(WINDOW_HANDLE, "Selezionare il percorso di salvataggio:", OPTIONS, strPath)
If objFolder Is Nothing Then
ShowOpenFolder="C:"
End If
Set objFolderItem = objFolder.Self
objPath = objFolderItem.Path