0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

VBA フォルダの更新日時を取得 その1

Last updated at Posted at 2021-04-25
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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?