Hi all
I have a file lister but cannot work out how to gain the owner name of the file/folder
Any ideas?
Thanks in advance
I have a file lister but cannot work out how to gain the owner name of the file/folder
Any ideas?
Code:
Dim iRow As Integer
Sub ListFiles()
iRow = 11
Call ListMyFiles(Range("A1"), Range("a2"))
End Sub
Sub ListMyFiles(mySourcePath, IncludeSubfolders)
Set MyObject = New Scripting.FileSystemObject
Set mySource = MyObject.GetFolder(mySourcePath)
On Error Resume Next
For Each myFile In mySource.Files
icol = 2
Cells(iRow, icol).Value = myFile.Name
icol = icol + 1
Cells(iRow, icol).Value = myFile.Path
icol = icol + 1
Cells(iRow, icol).Value = myFile.DateLastModified
icol = icol + 1
iRow = iRow + 1
Next
If IncludeSubfolders Then
For Each mySubFolder In mySource.SubFolders
Call ListMyFiles(mySubFolder.Path, True)
Next
End If
End Sub
Thanks in advance