The FileSystemObject VBA GetParentFolderName function returns the name of the parent folder of a given file or folder path.
- BuildPath
- CopyFile
- CopyFolder
- CreateFolder
- CreateTextFile
- DeleteFile
- DeleteFolder
- DriveExists
- FileExists
- FolderExists
- GetAbsolutePathName
- GetBaseName
- GetDrive
- GetDriveName
- GetExtensionName
- GetFile
- GetFileName
- GetFolder
- GetParentFolderName
- GetSpecialFolder
- GetTempName
- MoveFile
- MoveFolder
- OpenTextFile
VBA GetParentFolderName Syntax
1 | fso.GetParentFolderName( path ) |
path
The path of the file or folder of which you want to obtain the parent folder name.
VBA GetParentFolderName Examples
1 2 3 | Set fso = CreateObject( "Scripting.FileSystemObject" ) fso.GetParentFolderName( "C:\Src\Subfolder\") 'Result: " Src" |