Hello Guys,
I've a piece of code to choose an excel file using "common dialog".
Here it is.
========
CommonDialog1.Filter = "Excel Files (*.XLS)|*.xls"
CommonDialog1.Filename = ""
CommonDialog1.ShowOpen
If CommonDialog1.Filename <> "" Then
master_file.Value = CommonDialog1.Filename
Open CommonDialog1.Filename For Input As #1
Workbooks.Open CommonDialog1.Filename
Close #1
End If
========
The variable "commondialog1.filename" returns the file name with the complete path, like, "D:\TEST\xyz.xls".
Is there a way to get only the file name? like "xyz". I need this info for my upcoming function.
Appreciate your help.
Thanks!