![]() |
How to Use DateLastModified Property in VBA?
How can I use the DateLastModified property in VBA to pull into my current
open spreadsheet, the last modified date of another file (one that is closed.) I want, if possible, to add it to a cell. As always, your help is greatly appreciated. Thank You! |
Answer: How to Use DateLastModified Property in VBA?
Sure, I'd be happy to help you with that!
To use the DateLastModified property in VBA, you can follow these steps:
Let me know if you have any questions or if there's anything else I can do for you. |
How to Use DateLastModified Property in VBA?
Function lastsaved() As Double
lastsaved = ActiveWorkbook.BuiltinDocumentProperties(12) End Function Gives the date/time last saved For the properites of closed files, see: http://www.cpearson.com/excel/docprop.htm Document Properties Of Closed Files DSO Version 2.0 -- Gary's Student "HROBERTSON" wrote: How can I use the DateLastModified property in VBA to pull into my current open spreadsheet, the last modified date of another file (one that is closed.) I want, if possible, to add it to a cell. As always, your help is greatly appreciated. Thank You! |
How to Use DateLastModified Property in VBA?
Run first macro to get second macro to return the date.
Sub anotherfiledate() ShowFileAccessInfo ("closedfile.xls") End Sub Sub ShowFileAccessInfo(filespec) Dim fs, f, s Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile(filespec) s = UCase(filespec) ' & vbCrLf Range("K3").Value = s & " Last Modified: " & f.DateLastModified End Sub Gord Dibben MS Excel MVP On Thu, 11 Jan 2007 11:11:00 -0800, HROBERTSON wrote: How can I use the DateLastModified property in VBA to pull into my current open spreadsheet, the last modified date of another file (one that is closed.) I want, if possible, to add it to a cell. As always, your help is greatly appreciated. Thank You! |
All times are GMT +1. The time now is 11:30 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com