Hay una manera sencilla (Sin utilizar FSO) de saber la fecha de creacion y/o modificacion de un fichero cualquiera FileSystem.FileDateTime("C:\ruta\fichero.mdb") Esto te dará o la fecha de creacion o la fecha de modificacion del fichero (EN caso de que haya ocurrido dicha contingencia) Si quieres saber ambos atributos de forma independiente, tendríamos que irnos al sistema FSO (File System Object) Aquí te mando el procedimiento InformacionFichero que te muestra directamente los datos: Fecha de creación Fecha de último acceso Fecha de modificación Tamaño de cualquier fichero que le pases como parámetro Y la función FechaFichero(Fichero, TipoDeFecha) que te devolverá la fecha de creación, acceso ó modificación en función de que tipo de fecha tome alguno de los valores: tfFechaCreacion tfFechaAcceso tfFechaModificacion El parámetro TipoDeFecha es opcional. Si no se pasa devuelve la fecha de creación del fichero. _________________________________________________ Option Explicit Private Const GENERIC_WRITE = &H40000000 Private Const OPEN_EXISTING = 3 Private Const FILE_SHARE_READ = &H1 Private Const FILE_SHARE_WRITE = &H2 Private Const FO_DELETE = &H3 Public Enum TipoFecha tfFechaCreacion tfFechaAcceso tfFechaModificacion End Enum Private Type FILETIME dwLowDateTime As Long dwHighDateTime As Long End Type Private Type SYSTEMTIME wYear As Integer wMonth As Integer wDayOfWeek As Integer wDay As Integer wHour As Integer wMinute As Integer wSecond As Integer wMilliseconds As Integer End Type Private Type SHFILEOPSTRUCT hWnd As Long wFunc As Long pFrom As String pTo As String fFlags As Integer fAborted As Boolean hNameMaps As Long sProgress As String End Type Private Declare Function CreateFile _ Lib "kernel32" _ Alias "CreateFileA" ( _ ByVal lpFileName As String, _ ByVal dwDesiredAccess As Long, _ ByVal dwShareMode As Long, _ lpSecurityAttributes As Long, _ ByVal dwCreationDisposition As Long, _ ByVal dwFlagsAndAttributes As Long, _ ByVal hTemplateFile As Long _ ) As Long Private Declare Function GetFileSize _ Lib "kernel32" ( _ ByVal hFile As Long, _ lpFileSizeHigh As Long _ ) As Long Private Declare Function GetFileTime _ Lib "kernel32" ( _ ByVal hFile As Long, _ lpCreationTime As FILETIME, _ lpLastAccessTime As FILETIME, _ lpLastWriteTime As FILETIME _ ) As Long Private Declare Function FileTimeToSystemTime _ Lib "kernel32" ( _ lpFileTime As FILETIME, _ lpSystemTime As SYSTEMTIME _ ) As Long Private Declare Function FileTimeToLocalFileTime _ Lib "kernel32" ( _ lpFileTime As FILETIME, _ lpLocalFileTime As FILETIME _ ) As Long Public Sub InformacionFichero(ByVal Fichero As String) ' ***************************************************** ' Este procedimiento muestra las fechas de ' Creación, Último acceso y Modificación ' así como el tamaño del fichero pasado como parámetro ' Pamplona - 23/9/2004 - Eduardo Olaz - eduardo@olaz.net ' ***************************************************** Dim lngHandle As Long Dim lngOcupacion As Long Dim ftmCreacion As FILETIME Dim ftmAcceso As FILETIME Dim ftmModificacion As FILETIME Dim ftmFechaCreacion As FILETIME Dim ftmFechaAcceso As FILETIME Dim ftmFechaModificacion As FILETIME Dim stmSysTime As SYSTEMTIME Dim stmFechaCreacion As SYSTEMTIME Dim stmFechaAcceso As SYSTEMTIME Dim stmFechaModificacion As SYSTEMTIME Dim strInforme As String lngHandle = CreateFile( _ Fichero, _ GENERIC_WRITE, _ FILE_SHARE_READ Or FILE_SHARE_WRITE, _ ByVal 0&, _ OPEN_EXISTING, _ 0, _ 0) GetFileTime lngHandle, ftmCreacion, ftmAcceso, ftmModificacion FileTimeToLocalFileTime ftmCreacion, ftmFechaCreacion FileTimeToLocalFileTime ftmAcceso, ftmFechaAcceso FileTimeToLocalFileTime ftmModificacion, ftmFechaModificacion FileTimeToSystemTime ftmFechaCreacion, stmFechaCreacion FileTimeToSystemTime ftmFechaAcceso, stmFechaAcceso FileTimeToSystemTime ftmFechaModificacion, stmFechaModificacion strInforme = "Fichero " & Fichero _ & vbCrLf & vbCrLf _ & "Fecha de creación " _ & CStr(stmFechaCreacion.wDay) _ & "/" & CStr(stmFechaCreacion.wMonth) _ & "/" & CStr(stmFechaCreacion.wYear) _ & vbCrLf _ & "Fecha de último acceso " _ & CStr(stmFechaAcceso.wDay) _ & "/" & CStr(stmFechaAcceso.wMonth) _ & "/" & CStr(stmFechaAcceso.wYear) _ & vbCrLf _ & "Fecha de modificación " _ & CStr(stmFechaModificacion.wDay) _ & "/" & CStr(stmFechaModificacion.wMonth) _ & "/" & CStr(stmFechaModificacion.wYear) _ & vbCrLf & vbCrLf _ & "Tamaño " _ & Format(GetFileSize(lngHandle, lngOcupacion), "#,##0") _ & " Bytes" MsgBox strInforme, _ vbInformation + vbOKOnly, _ " Datos del fichero " & Fichero End Sub Public Function FechaFichero( _ ByVal Fichero As String, _ Optional TipoDeFecha As TipoFecha = tfFechaCreacion _ ) As Date ' ***************************************************** ' Esta función devuelve las fechas de ' Creación, Último acceso ó Modificación ' del fichero pasado como parámetro ' en función del parámetro opcional tfFechaCreacion ' Si no se pasa tfFechaCreacion devuelve la fecha de creación ' Pamplona - 23/9/2004 - Eduardo Olaz - eduardo@olaz.net ' ***************************************************** Dim lngHandle As Long Dim ftmCreacion As FILETIME Dim ftmAcceso As FILETIME Dim ftmModificacion As FILETIME Dim ftmFechaFichero As FILETIME Dim ftmFechaLocal As FILETIME Dim stmSysTime As SYSTEMTIME lngHandle = CreateFile( _ Fichero, _ GENERIC_WRITE, _ FILE_SHARE_READ Or FILE_SHARE_WRITE, _ ByVal 0&, _ OPEN_EXISTING, _ 0, _ 0) GetFileTime lngHandle, ftmCreacion, ftmAcceso, ftmModificacion Select Case TipoDeFecha Case tfFechaCreacion ftmFechaFichero = ftmCreacion Case tfFechaAcceso ftmFechaFichero = ftmAcceso Case tfFechaModificacion ftmFechaFichero = ftmModificacion Case Else Exit Function End Select FileTimeToLocalFileTime ftmFechaFichero, ftmFechaLocal FileTimeToSystemTime ftmFechaFichero, stmSysTime FechaFichero = _ CDate(CStr(stmSysTime.wMonth) _ & "/" & CStr(stmSysTime.wDay) _ & "/" & CStr(stmSysTime.wYear)) End Function