I am using this code, it gives the file name like "C:\File\sample.txt". But I am in need of getting path like "C:\File\". How can I get this path?
Private Sub cmdBrowse_Click()
CommonDialog1.ShowOpen
txtPath1.Text = CommonDialog1.FileName
End Sub