Option Explicit
Sub a()
MsgBox Dossier
End Sub
Function Dossier() As String
Dim TSpl() As String
'Fichier non encore enregistré
If Len(ThisWorkbook.Path) = 0 Then
Dossier = "N/A"
Exit Function
End If
'Séparateur Windows "\"
If InStr(ThisWorkbook.Path, "\") > 0 Then
TSpl = Split(ThisWorkbook.Path, "\")
End If
'Séparateur Réseau "/"
If InStr(ThisWorkbook.Path, "/") > 0 Then
TSpl = Split(ThisWorkbook.Path, "/")
End If
If Not (Not TSpl) Then
Dossier =...