0

As the title suggests, I'm trying to get the date that a file was last modified to return in a cell. I have multiple files, each with a unique folder path. I think the best way to do this is to have a column of cells with the file path in each, then create a function that will return the last modified date of that file path.

I have the following code:

Function LastModified() as Date

   LastModified = ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")

End Function

I'm not sure how I can edit it to meet my needs. Pointers or references much appreciated!!

  • 4
    I'd suggest a different approach, check out usage of FileSystemObject(http://stackoverflow.com/questions/3233203/how-do-i-use-filesystemobject-in-vba). It is absolutely possible to iterate through a list of spreadsheets and scrape their date last modified without having to resort to opening the workbooks. – Zerk Feb 03 '17 at 19:17
  • Which Excel are you using 2010,2013,2016...? – cyboashu Feb 03 '17 at 19:21
  • @cyboashu using 2016 – Juan Sebastian Medina Feb 03 '17 at 19:27
  • 2
    Then you can also use Data--> New Query--->From File....and just select name, modified date columns. NO VBA required :) http://excelunplugged.com/2015/02/10/get-data-from-folder-in-power-query/ – cyboashu Feb 03 '17 at 19:32

0 Answers0