FILEDATETIME

FILEDATETIME(pathname)

Returns the date and time when a file was created or last modified (Date).


pathnameThe full pathname of the file you want to examine (String).

REMARKS
* The "pathname" may include a directory and drive.
* If "pathname" is not a valid file path, then you will get a run time error.
* You can use the FILEATTR function to return the file mode of an open file.
* You can use the FILELEN function to return the length of a file in bytes.
* You can use the GETATTR function to return the attributes of a file or directory.
* The equivalent .NET function is Microsoft.VisualBasic.FileSystem.FileDateTime
* For the Microsoft documentation refer to learn.microsoft.com

Debug.Print FileDateTime("C:\text.txt")    '= "21/11/22 14:08:23 PM"  

Dim sFolderPath As String
sFolderPath = "C:\temp\myfile.xlsm"
Debug.Print FileDateTime(sFolderPath) '= "07/03/21 06:28:54 PM"

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top