I've used the below VB script in my .hta application for selecting the folder. But when there is no folder is selected and I click 'Cancel' button then am getting Script error: Object Required: 'Wscript'.
Sub ButtOutFolderConst MY_COMPUTER = &H11&
Const WINDOW_HANDLE = 0
Const OPTIONS = 0
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(MY_COMPUTER)
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path
Set objFolder = objShell.BrowseForFolder _
(WINDOW_HANDLE, "Select a folder:", OPTIONS, strPath)
If objFolder Is Nothing Then
Wscript.Quit
End If
Set objFolderItem = objFolder.Self
objPath = objFolderItem.Path
OUTFOLDERPATH = objPath
OutpathTxt.value = OUTFOLDERPATH
End Sub