What you are looking for must be something like this
Dim strFile As String
Dim d
Set d = CreateObject("Scripting.FileSystemObject")
strFile = "C:\File.xls"
MsgBox d.getfilename(strFile)
This is just code written for displaying the file name when a user input based
path and filename are provided. i trust you can fill in the details for doing
what you needed to do.