eccoti la funzione,
non sono sicuro che funzioni perchè ho modificato un po' una
funzione che avevo fatto per me.
Comunque mi sembra tutto a posto.

Private function percorso(path As String) as string
Dim j As Integer
j = Len(path)
Do While (Mid(path, j, 1) <> "\")
j = j - 1
Loop
percorso = Mid(path, 1, j - 1)
End Sub

Ciao ciao