28 | 04 | 2017

Get Pathname From File

You have a filepath including the filename but you only need the path without the name. The path can beĀ 

Function GetPathName(strFile As String) As String

'return the path for a file (folder only)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
GetPathName = fso.GetParentFolderName(strFile)

End Function
Login

Sign up now and upload your code to the website.

Help us to continue.....
Statistics
Articles View Hits
2236206
Latest Articles