Function GetFilePath(theFileName As String) As String
Dim WhereSlash As Integer
If Right(theFileName, 1) = "\" Then GetFilePath = theFileName: Exit Function
If Right(theFileName, 1) = ":" Then GetFilePath = theFileName: Exit Function
WhereSlash = InStrRev(theFileName, "\")
If WhereSlash > 0 Then
GetFilePath = Left$(theFileName, WhereSlash)
End If
End Function