Hi all,
I'm trying to get the user to select a folder in which to save files. I need the path, but shell32.shell.BrowseForFolder returns a shell32.Folder object, which doesn't have a .Path method. Here is the code, it's really simple:
I feel like the solution to this should be pretty simple, but I have not been able to figure it out and I need to be making progress. I'd be gratefull if someone could point me in the right direction.Code:'I've added the .Shell32 library Private Sub Browse4FolderButton_Click() Dim objShell As Shell Dim ssfSomething As Variant Dim objDestFolder As Folder ssfSomething = "P:/Capital Projects" Set objShell = New Shell Set objDestFolder = objShell.BrowseForFolder(0, "Destination Folder", 0, ssfSomething) 'I'm trying to get the user to pick a folder, and then get the path of that folder If (Not objDestFolder Is Nothing) Then strPath = objDestFolder.Path ' This object (Folder) does not support the .Path method, so how do I get the path of a folder? End If Set objDestFolder = Nothing Set objShell = Nothing End Sub


Reply With Quote
