ciao Fausto,
non è farina del mio sacco...non ricordo esattamente dove l'ho presa...
sarebbe forse da curare un po'....
guarda l'ultima sub per le personalizzazioni.
ciao, Sandro.
Option Explicit
Option Compare Database
'''''''''''''''''''''''''''''''''''
Private Const NULL_LONG As Long = 0&
Private Const C_ERROR As Long = -1&
Private Const OPEN_EXISTING = &H3
Private Const FILE_SHARE_READ = &H1
Private Const FILE_SHARE_WRITE = &H2
Private Const CREATE_ALWAYS = &H2
Private Const OPEN_ALWAYS = &H4
Private Const INVALID_HANDLE_VALUE = -1
Private Const ERROR_ALREADY_EXISTS = &HB7
Private Const GENERIC_ALL = &H10000000
Private Const GENERIC_EXECUTE = &H20000000
Private Const GENERIC_READ = &H80000000
Private Const GENERIC_WRITE = &H40000000
Public Const TIME_ZONE_ID_UNKNOWN = 0
Public Const TIME_ZONE_ID_STANDARD = 1
Public Const TIME_ZONE_ID_DAYLIGHT = 2
Public Const TIME_ZONE_ID_INVALID = -1
Public Enum FileDateToProcess
FileDateCreate = 1
FileDateLastAccess = 2
FileDateLastModified = 3
End Enum
Public Type FileTime
dwLowDateTime As Long
dwHighDateTime As Long
End Type
Public 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
Public Type TIME_ZONE_INFORMATION
Bias As Long
StandardName(0 To 31) As Integer
StandardDate As SYSTEMTIME
StandardBias As Long
DaylightName(0 To 31) As Integer
DaylightDate As SYSTEMTIME
DaylightBias As Long
End Type
Private Const FORMAT_MESSAGE_ALLOCATE_BUFFER = &H100
Private Const FORMAT_MESSAGE_ARGUMENT_ARRAY = &H2000
Private Const FORMAT_MESSAGE_FROM_HMODULE = &H800
Private Const FORMAT_MESSAGE_FROM_STRING = &H400
Private Const FORMAT_MESSAGE_FROM_SYSTEM = &H1000
Private Const FORMAT_MESSAGE_MAX_WIDTH_MASK = &HFF
Private Const FORMAT_MESSAGE_IGNORE_INSERTS = &H200
Private Const FORMAT_MESSAGE_TEXT_LEN = &HA0 ' from ERRORS.H C++ include file.
Private Declare PtrSafe Function LocalFileTimeToFileTime Lib "kernel32" _
(lpLocalFileTime As FileTime, _
lpFileTime As FileTime) As Long
Private Declare PtrSafe Function FileTimeToLocalFileTime Lib "kernel32" ( _
lpFileTime As FileTime, _
lpLocalFileTime As FileTime) As Long
Private Declare PtrSafe Function SystemTimeToFileTime Lib "kernel32" _
(lpSystemTime As SYSTEMTIME, _
lpFileTime As FileTime) As Long
Private Declare PtrSafe Function CreateFile Lib "kernel32" Alias "CreateFileA" _
(ByVal lpFilename As String, _
ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, _
ByVal lpSecurityAttributes As Long, _
ByVal dwCreationDisposition As Long, _
ByVal dwFlagsAndAttributes As Long, _
ByVal hTemplateFile As Long) As Long
Private Declare PtrSafe Function CloseHandle Lib "kernel32" _
(ByVal hObject As Long) As Long
Private Declare PtrSafe Function SetFileTimeCreate Lib "kernel32" Alias "SetFileTime" _
(ByVal hFile As Long, _
CreateTime As FileTime, _
ByVal LastAccessTime As Long, _
ByVal LastModified As Long) As Long
Private Declare PtrSafe Function SetFileTimeLastAccess Lib "kernel32" Alias "SetFileTime" _
(ByVal hFile As Long, _
ByVal CreateTime As Long, _
LastAccessTime As FileTime, _
ByVal LastModified As Long) As Long
Private Declare PtrSafe Function SetFileTimeLastModified Lib "kernel32" Alias "SetFileTime" _
(ByVal hFile As Long, _
ByVal CreateTime As Long, _
ByVal LastAccessTime As Long, _
LastModified As FileTime) As Long
Public Function GetSystemErrorMessageText(ErrorNumber As Long) As String
Dim ErrorText As String
Dim TextLen As Long
Dim FormatMessageResult As Long
Dim LangID As Long
' initialize the variables
LangID = 0& 'default language
ErrorText = String$(FORMAT_MESSAGE_TEXT_LEN, vbNullChar)
TextLen = Len(ErrorText)
On Error Resume Next
' Call FormatMessage to get the text of the error message
' associated with ErrorNumber.
FormatMessageResult = FormatMessage( _
dwFlags:=FORMAT_MESSAGE_FROM_SYSTEM Or _
FORMAT_MESSAGE_IGNORE_INSERTS, _
lpSource:=0&, _
dwMessageId:=ErrorNumber, _
dwLanguageId:=0&, _
lpBuffer:=ErrorText, _
nSize:=TextLen, _
Arguments:=0&)
On Error GoTo 0
If FormatMessageResult = 0& Then
MsgBox "An error occurred with the FormatMessage" & _
" API functiopn call. Error: " & _
CStr(Err.LastDllError) & _
" Hex(" & Hex(Err.LastDllError) & ")."
GetSystemErrorMessageText = vbNullString
Exit Function
End If
If FormatMessageResult > 0 Then
ErrorText = Left$(ErrorText, FormatMessageResult)
GetSystemErrorMessageText = ErrorText
Else
GetSystemErrorMessageText = "NO ERROR DESCRIPTION AVAILABLE"
End If
End Function
Public Function SetFileDateTime(FileName As String, _
FileDateTime As Double, WhichDateToChange As FileDateToProcess, _
Optional NoGMTConvert As Boolean = False) As Boolean
Dim FileHandle As Long
Dim Res As Long
Dim ErrNum As Long
Dim ErrText As String
Dim tFileTime As FileTime
Dim tLocalTime As FileTime
Dim tSystemTime As SYSTEMTIME
If Dir(FileName) = vbNullString Then
SetFileDateTime = False
Exit Function
End If
With tSystemTime
.wYear = Year(FileDateTime)
.wMonth = Month(FileDateTime)
.wDay = Day(FileDateTime)
.wDayOfWeek = Weekday(FileDateTime) - 1
.wHour = Hour(FileDateTime)
.wMinute = Minute(FileDateTime)
.wSecond = Second(FileDateTime)
End With
Res = SystemTimeToFileTime(lpSystemTime:=tSystemTime, lpFileTime:=tLocalTime)
If Res = 0 Then
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrorNumber:=ErrNum)
Debug.Print "Error from SystemTimeToFileTime" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
SetFileDateTime = False
Exit Function
End If
If NoGMTConvert = False Then
Res = LocalFileTimeToFileTime(lpLocalFileTime:=tLocalTime, lpFileTime:=tFileTime)
Else
tFileTime.dwHighDateTime = tLocalTime.dwHighDateTime
tFileTime.dwLowDateTime = tLocalTime.dwLowDateTime
Res = 2
End If
If Res = 0 Then
''''''''''''''''''''''
' An error occurred.
''''''''''''''''''''''syst
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrorNumber:=ErrNum)
Debug.Print "Error from LocalFileTimeToFileTime" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
SetFileDateTime = False
Exit Function
End If
FileHandle = CreateFile(lpFilename:=FileName, _
dwDesiredAccess:=GENERIC_WRITE, _
dwShareMode:=FILE_SHARE_READ Or FILE_SHARE_WRITE, _
lpSecurityAttributes:=ByVal 0&, _
dwCreationDisposition:=OPEN_EXISTING, _
dwFlagsAndAttributes:=0, _
hTemplateFile:=0)
If FileHandle = INVALID_HANDLE_VALUE Then
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrorNumber:=ErrNum)
Debug.Print "Error from CreateFile" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
SetFileDateTime = False
Exit Function
End If
Select Case WhichDateToChange
Case FileDateCreate
Res = SetFileTimeCreate( _
hFile:=FileHandle, _
CreateTime:=tFileTime, _
LastAccessTime:=NULL_LONG, _
LastModified:=NULL_LONG)
If Res = 0 Then
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrNum)
Debug.Print "Error With SetFileTimeCreate:" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
SetFileDateTime = False
Exit Function
End If
Case FileDateLastAccess
Res = SetFileTimeLastAccess( _
hFile:=FileHandle, _
CreateTime:=NULL_LONG, _
LastAccessTime:=tFileTime, _
LastModified:=NULL_LONG)
If Res = 0 Then
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrNum)
Debug.Print "Error With SetFileTimeLastAccess:" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
SetFileDateTime = False
Exit Function
End If
Case FileDateLastModified
Res = SetFileTimeLastModified( _
hFile:=FileHandle, _
CreateTime:=NULL_LONG, _
LastAccessTime:=NULL_LONG, _
LastModified:=tFileTime)
If Res = 0 Then
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrNum)
Debug.Print "Error With SetFileTimeLastModified:" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
SetFileDateTime = False
Exit Function
End If
Case Else
Debug.Print "Invalid value for WhichDateToChange: " & CStr(WhichDateToChange)
CloseHandle FileHandle
SetFileDateTime = False
Exit Function
End Select
CloseHandle FileHandle
SetFileDateTime = True
End Function
Public Function GetFileDateTime(FileName As String, _
WhichDateToGet As FileDateToProcess, _
Optional NoGMTConvert As Boolean = False) As Double
Dim FileHandle As Long
Dim Res As Long
Dim ErrNum As Long
Dim ErrText As String
Dim tFileTime As FileTime
Dim tLocalTime As FileTime
Dim tSystemTime As SYSTEMTIME
Dim ResultTime As Double
Const C_ERROR As Double = -1
''''''''''''''''''''''''''''''''''''
' Ensure the file exists.
''''''''''''''''''''''''''''''''''''
If Dir(FileName) = vbNullString Then
GetFileDateTime = C_ERROR
Exit Function
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Here, we use CreateFile to open the existing file
' named in FileName. The OPEN_EXISTING flag indicates
' that we are opening an existing flag.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
FileHandle = CreateFile(lpFilename:=FileName, dwDesiredAccess:=GENERIC_READ, _
dwShareMode:=FILE_SHARE_READ Or FILE_SHARE_WRITE, lpSecurityAttributes:=ByVal 0&, _
dwCreationDisposition:=OPEN_EXISTING, dwFlagsAndAttributes:=0, hTemplateFile:=0)
If FileHandle = INVALID_HANDLE_VALUE Then
''''''''''''''''''''''
' An error occurred.
''''''''''''''''''''''
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrorNumber:=ErrNum)
Debug.Print "Error from SystemTimeToFileTime" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
GetFileDateTime = C_ERROR
Exit Function
End If
Select Case WhichDateToGet
Case FileDateCreate
'''''''''''''''''''''''''''''''''''''''''''''''''''
' Call the GetFileTimeCreate flavor of GetFileTime.
'''''''''''''''''''''''''''''''''''''''''''''''''''
Res = GetFileTimeCreate( _
hFile:=FileHandle, _
CreateTime:=tFileTime, _
LastAccessTime:=NULL_LONG, _
LastModified:=NULL_LONG)
If Res = 0 Then
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrNum)
Debug.Print "Error With GetFileTimeCreate (GetFileTime):" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
GetFileDateTime = C_ERROR
Exit Function
End If
Case FileDateLastAccess
'''''''''''''''''''''''''''''''''''''''''''''''''''
' Call the GetFileTimeLastAccess flavor of GetFileTime.
'''''''''''''''''''''''''''''''''''''''''''''''''''
Res = GetFileTimeLastAccess( _
hFile:=FileHandle, _
CreateTime:=NULL_LONG, _
LastAccessTime:=tFileTime, _
LastModified:=NULL_LONG)
If Res = 0 Then
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrNum)
Debug.Print "Error With SetFileTimeLastAccess (SetFileTime):" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
GetFileDateTime = C_ERROR
Exit Function
End If
Case FileDateLastModified
'''''''''''''''''''''''''''''''''''''''''''''''''''
' Call the GetFileTimeLastModified flavor of GetFileTime.
'''''''''''''''''''''''''''''''''''''''''''''''''''
Res = GetFileTimeLastModified( _
hFile:=FileHandle, _
CreateTime:=NULL_LONG, _
LastAccessTime:=NULL_LONG, _
LastModified:=tFileTime)
If Res = 0 Then
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrNum)
Debug.Print "Error With GetFileTimeLastModified (GetFileTime):" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
GetFileDateTime = C_ERROR
Exit Function
End If
Case Else
''''''''''''''''''''''''''''''''''''''
' Invalid value for WhichDateToChange.
''''''''''''''''''''''''''''''''''''''
Debug.Print "Invalid value for WhichDateToChange: " & CStr(WhichDateToGet)
CloseHandle FileHandle
GetFileDateTime = C_ERROR
Exit Function
End Select
''''''''''''''''''''''''''''''''''''''''''''''
' Convert the FileTime (GMT) to LocalFileTime)
' if NoGMTConvert is omitted or False.
''''''''''''''''''''''''''''''''''''''''''''''
If NoGMTConvert = False Then
Res = FileTimeToLocalFileTime(lpFileTime:=tFileTime, lpLocalFileTime:=tLocalTime)
Else
'''''''''''''''''''''''''''''''''''''''''''''''''''
' We are NOT converting from GMT.
'''''''''''''''''''''''''''''''''''''''''''''''''''
tLocalTime.dwHighDateTime = tFileTime.dwHighDateTime
tLocalTime.dwLowDateTime = tFileTime.dwLowDateTime
Res = 2
End If
If Res = 0 Then
'''''''''''''''''''''
' An error occurred
'''''''''''''''''''''
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrNum)
Debug.Print "Error With FileTimeToLocalFileTime:" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
GetFileDateTime = C_ERROR
Exit Function
End If
''''''''''''''''''''''''''''''''''''
' Convert the FileTime to SystemTime
''''''''''''''''''''''''''''''''''''
Res = FileTimeToSystemTime(lpFileTime:=tLocalTime, lpSystemTime:=tSystemTime)
If Res = 0 Then
'''''''''''''''''''''
' An error occurred
'''''''''''''''''''''
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrNum)
Debug.Print "Error With FileTimeToSystemTime:" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
GetFileDateTime = C_ERROR
Exit Function
End If
'''''''''''''''''''''''''''''''''
' Convert from SystemTime to VB
' Time value.
'''''''''''''''''''''''''''''''''
ResultTime = DateSerial(tSystemTime.wYear, tSystemTime.wMonth, tSystemTime.wDay) + _
TimeSerial(tSystemTime.wHour, tSystemTime.wMinute, tSystemTime.wSecond)
'''''''''''''''''''''''''''''''''
' Close the file and return True.
'''''''''''''''''''''''''''''''''
CloseHandle FileHandle
GetFileDateTime = ResultTime
End Function
'Public Function GetFileDateTimeAsFILETIME(FileName As String, _
WhichDateToGet As FileDateToProcess, FTime As FileTime, _
Optional ConvertFromGMT As Boolean = False) As Boolean
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' GetFileTimeAsFILETIME
' This function populates the FTime FILETIME structure with the file data
' specified by WhichDateToGet for the file FileName. Note that there
' is no conversion from GMT Time here
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim FileHandle As Long
Dim ErrNum As Long
Dim ErrText As String
Dim tFileTime As FileTime
Dim Res As Long
Dim tLocalFileTime As FileTime
Const C_ERROR As Boolean = False
''''''''''''''''''''''''''''''''''''
' Ensure the file exists.
''''''''''''''''''''''''''''''''''''
If Dir(FileName) = vbNullString Then
GetFileDateTimeAsFILETIME = C_ERROR
Exit Function
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Here, we use CreateFile to open the existing file
' named in FileName. The OPEN_EXISTING flag indicates
' that we are opening an existing flag.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
FileHandle = CreateFile(lpFilename:=FileName, dwDesiredAccess:=GENERIC_READ, _
dwShareMode:=FILE_SHARE_READ Or FILE_SHARE_WRITE, lpSecurityAttributes:=ByVal 0&, _
dwCreationDisposition:=OPEN_EXISTING, dwFlagsAndAttributes:=0, hTemplateFile:=0)
If FileHandle = INVALID_HANDLE_VALUE Then
''''''''''''''''''''''
' An error occurred.
''''''''''''''''''''''
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrorNumber:=ErrNum)
Debug.Print "Error from SystemTimeToFileTime" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
GetFileDateTimeAsFILETIME = C_ERROR
Exit Function
End If
Select Case WhichDateToGet
Case FileDateCreate
'''''''''''''''''''''''''''''''''''''''''''''''''''
' Call the GetFileTimeCreate flavor of GetFileTime.
'''''''''''''''''''''''''''''''''''''''''''''''''''
Res = GetFileTimeCreate( _
hFile:=FileHandle, _
CreateTime:=tFileTime, _
LastAccessTime:=NULL_LONG, _
LastModified:=NULL_LONG)
If Res = 0 Then
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrNum)
Debug.Print "Error With GetFileTimeAsFILETIME:" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
GetFileDateTimeAsFILETIME = C_ERROR
Exit Function
End If
Case FileDateLastAccess
'''''''''''''''''''''''''''''''''''''''''''''''''''
' Call the GetFileTimeLastAccess flavor of GetFileTime.
'''''''''''''''''''''''''''''''''''''''''''''''''''
Res = GetFileTimeLastAccess( _
hFile:=FileHandle, _
CreateTime:=NULL_LONG, _
LastAccessTime:=tFileTime, _
LastModified:=NULL_LONG)
If Res = 0 Then
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrNum)
Debug.Print "Error With GetFileTimeAsFILETIME:" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
GetFileDateTimeAsFILETIME = C_ERROR
Exit Function
End If
Case FileDateLastModified
'''''''''''''''''''''''''''''''''''''''''''''''''''
' Call the GetFileTimeLastModified flavor of GetFileTime.
'''''''''''''''''''''''''''''''''''''''''''''''''''
Res = GetFileTimeLastModified( _
hFile:=FileHandle, _
CreateTime:=NULL_LONG, _
LastAccessTime:=NULL_LONG, _
LastModified:=tFileTime)
If Res = 0 Then
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrNum)
Debug.Print "Error With GetFileTimeAsFILETIME:" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
GetFileDateTimeAsFILETIME = C_ERROR
Exit Function
End If
Case Else
''''''''''''''''''''''''''''''''''''''
' Invalid value for WhichDateToChange.
''''''''''''''''''''''''''''''''''''''
Debug.Print "Invalid value for WhichDateToChange: " & CStr(WhichDateToGet)
CloseHandle FileHandle
GetFileDateTimeAsFILETIME = C_ERROR
Exit Function
End Select
If ConvertFromGMT = False Then
'''''''''''''''''''''''''''''''''''''''''''''''
' ConvertFromGMT is False, so we don't do any
' conversion from GMT. The value placed in FTime
' is a GMT value. Set the elements of the FTime
' variable that was passed in to this function.
'''''''''''''''''''''''''''''''''''''''''''''''
FTime.dwHighDateTime = tFileTime.dwHighDateTime
FTime.dwLowDateTime = tFileTime.dwLowDateTime
Else
'''''''''''''''''''''''''''''''''''''''''''''''
' ConvertFromGMT is True, so we must convert
' fFileTime from GMT to a local time value.
' Convert to local time and then set the elements
' of the FTime variable that was passed into
' this procedure.
'''''''''''''''''''''''''''''''''''''''''''''''
Res = FileTimeToLocalFileTime(lpFileTime:=tFileTime, lpLocalFileTime:=tLocalFileTime)
If Res = 0 Then
ErrNum = Err.LastDllError
ErrText = GetSystemErrorMessageText(ErrNum)
Debug.Print "Error With FileTimeToLocalFileTime:" & vbCrLf & _
"Err: " & CStr(ErrNum) & vbCrLf & _
"Desc: " & ErrText
GetFileDateTimeAsFILETIME = C_ERROR
Exit Function
End If
FTime.dwHighDateTime = tLocalFileTime.dwHighDateTime
FTime.dwLowDateTime = tLocalFileTime.dwLowDateTime
End If
'''''''''''''''''''''''''''''''''''''
' If we made it this far, we're
' successful so return True.
'''''''''''''''''''''''''''''''''''''
GetFileDateTimeAsFILETIME = True
End Function
Sub revisedDateCreation()
Dim FName As String
Dim Result As Boolean
Dim TheNewTime As Double
Dim WhatTime As FileDateToProcess
Dim TheNewDate As Double
'''''''''''''''''''''''''''''''
' Craete the new date and time.
'''''''''''''''''''''''''''''''
TheNewDate = DateSerial(2015, 1, 1) '<---customizza la data
TheNewDate = TheNewDate + TimeSerial(11, 0, 0) '<---customizza l'ora
FName = "pathCompletoDelFile" **** '<---customizza il nome del file
Result = SetFileDateTime(FileName:=FName, FileDateTime:=TheNewDate, _
WhichDateToChange:=1, NoGMTConvert:=False)
If Result = True Then
Debug.Print "File date/time successfully modified."
Else
Debug.Print "An error occurred with SetFileDateTime."
End If
End Sub