Hello
I'm trying to use a CDC to select a directory only (for exporting an XLS spreadsheet - users don't get to choose the file name). The code I've got works, but only if you select a file within the directory. Does anyone know how I can make it so they just click on a directory, then click Open and then I can grab the path of the directory?
Here's my code
Private Sub btnFileOutput_Click()
With Me.cdlFileOutput
.DialogTitle = "ƒf[ƒ^o—Í"
.InitDir = "c:\"
.FileName = ""
.Flags = 0
.ShowOpen
End With
Me.tbOutPutFile.Value = Left(cdlFileOutput.FileName, Len(cdlFileOutput.FileName) - Len(cdlFileOutput.FileTitle))
End Sub
Thanks so much!
Greg
I'm trying to use a CDC to select a directory only (for exporting an XLS spreadsheet - users don't get to choose the file name). The code I've got works, but only if you select a file within the directory. Does anyone know how I can make it so they just click on a directory, then click Open and then I can grab the path of the directory?
Here's my code
Private Sub btnFileOutput_Click()
With Me.cdlFileOutput
.DialogTitle = "ƒf[ƒ^o—Í"
.InitDir = "c:\"
.FileName = ""
.Flags = 0
.ShowOpen
End With
Me.tbOutPutFile.Value = Left(cdlFileOutput.FileName, Len(cdlFileOutput.FileName) - Len(cdlFileOutput.FileTitle))
End Sub
Thanks so much!
Greg