none
Vba Excel - Get Workbook Author

    Question

  • Hi guys,
     
    The code below makes an excel spreadsheet wich retrieves the names and details of the files contained into a specific folder.
    Does anyone knows how to get name (author) of the file?
    Thanks in advance,
    Aldo.
     
    Function GetListOfFilesInspecifiedFolder()
     Dim oFSO As Object, Folder As Object, File As Object
     Set oFSO = CreateObject("Scripting.FileSystemObject")
     Set Folder = oFSO.GetFolder(BaseDirectory)
     
     'Reads the name of each file
     RowNr = 3
     For Each File In Folder.Files
       Cells(RowNr, 6).Value = Format(File.DateCreated, "dd/mm/yyyy")
       Cells(RowNr, 7).Value = Format(File.DateLastModified, "dd/mm/yyyy")
       Cells(RowNr, 8).Value = Format(File.DateLastAccessed, "dd/mm/yyyy")
       Cells(RowNr, 8).Value = File.Author ????? ERROR!!!!
     Next File
     
     Set oFSO = Nothing
     Set Folder = Nothing
    End Function
    Tuesday, July 10, 2007 11:03 AM

Answers

All replies

  • If you are extracting details of Excel Workbooks alone you can use

     

    ActiveWorkbook.BuiltinDocumentProperties("Author").Value

     

    If you are getting for all types of files try with DSOFile.dll . Here you can extract both Custom & Summary Properties

     

    Cheers

    Shasur

    Tuesday, July 10, 2007 12:51 PM
  • Hi Shasur, I need details of all kind of files.

    Can you give me an example of how should I use DSO File.dll?

    Thanks,

    Aldo.

    Tuesday, July 10, 2007 1:13 PM
  • Here you have

     

    http://support.microsoft.com/kb/224351

     

    You can get a sample VB Project there.

     

    Extraction of data is fast using DSOFile

     

    Good luck

     

    Cheers

    Shasur

    Wednesday, July 11, 2007 8:19 AM