VBA Scripting FileSystemObject
Retrieve only the path from a file path
The GetParentFolderName method returns the parent folder for any path. While this can also be used with folders, it is arguably more useful for extracting the path from an absolute file path:
Note that the trailing path separator is not included in the returned string.