Sub test1()
Dim fso As FileSystemObject
Set fso = New FileSystemObject ' インスタンス化
Dim fl As Folder
Set fl = fso.GetFolder("C:\Windows") ' フォルダを取得
Dim d As Date
' d = fl.DateCreated ' 作成日時を取得
' d = fl.DateLastAccessed ' アクセス日時を取得
d = fl.DateLastModified ' 更新日時を取得
Debug.Print (d)
Debug.Print Hour(d) & ":" & Minute(d)
ActiveSheet.Range("A1") = d
ActiveSheet.Range("A2") = Hour(d) & ":" & Minute(d)
' 後始末
Set fso = Nothing
End Sub
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme