Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File path only using Common Dialog Control 1

Status
Not open for further replies.

shadylane

Programmer
Jan 23, 2003
21
JP
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
 
Er... Just noticed the Common Dialog Control explanator thing a few posts down - I don't think it exactly does what I want to do though...
Greg
 
Hi, I've posted what I think is a solution to your question in thread705-457897

Good Luck

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top