Hi I am using BrowseForFolder to Select Folders. The code works fine but everytime I click the "Cancel" Button an Error occurs.
Here is the code:
Here is the code:
Code:
Dim objShell
Dim strFileName
Dim strFilePath
Dim objFile
Set objShell = CreateObject("Shell.Application")
Set objFile = objShell.BrowseForFolder(0, "Choose a file:", &H4000, "C:\")
strFileName = objFile.Title
strFilePath = objFile.self.Path