Try this
Private Sub ABC( )
Dim posn As Integer, i As Integer
Dim flName As String
Dim fPath As String ' path of file
flName = ThisWorkbook. FullName
posn = 0
For i = 1 To Len(flName)
If (Mid(flName, i, 1) = "\") Then posn = i
Next i
fPath = Left(flName, posn - 1)
msgbox fpath
End Sub