Author : leesoj
Date Submitted : 7/20/2007
Category : File Manipulation
Compatibility : VB 6,VB 3
This code has been accessed 3138 times.
Task : Simple VB code to know the date and time when a file was created or last modified.
Declarations
Code
'Simple VB code to know the date and time when a file was created
'or last modified.
Sub FileCreatedDateTime()
Dim filename As String
On Error GoTo errHandler
filename = InputBox("Please enter file name ?", "Input")
If Trim(filename) <> "" Then
MsgBox FileDateTime(filename)
Else
MsgBox "Invalid filename !!!", vbCritical + vbOKOnly, "Error!!!"
End If
errHandler:
If Err.Number <> 0 Then
MsgBox "Error Description :" & Err.Description & vbCrLf & " Error No : " & Err.Number, vbCritical + vbOKOnly, "Error!!!"
End If
End Sub