This is a very simple way to get just the full directory path of a file passed in.
Public Function GetTheFilePath(ByVal strFile) As String
Files = Split(strFile, "\")
For I = 0 to (UBound(Files) - 1)
FilePath = FilePath & Files(I) & "\"
Next
GetTheFilePath = FilePath
End Function
Usage
MyFilePath = GetTheFilePath("C:\testing\jim\file.txt")
will return:
C:\testing\jim\