gpt4 book ai didi

excel - 在excel中获取文件夹的创建时间

转载 作者:行者123 更新时间:2023-12-03 00:09:15 25 4
gpt4 key购买 nike

如何在Excel中获取文件夹的创建时间?

我知道

FileDateTime(FileOrFoldername)

可以检索时间,但那是“创建或最后修改日期”;还有

Set oFS = CreateObject("Scripting.FileSystemObject")
FileCreatedAt = oFS.GetFile(PathWithFilename).DateCreated

可以检索文件创建时间,但这不适用于文件夹。

最佳答案

使用以下子命令获取文件夹创建日期和时间

Sub DirDate()
Dim fso As New Scripting.FileSystemObject
Dim fld As Scripting.Folder
Set fld = fso.GetFolder("c:\windows")
MsgBox fld.DateCreated
End Sub

You have to active the Microsoft Scripting Runtime in references. See below screenshot.

enter image description here

关于excel - 在excel中获取文件夹的创建时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42406198/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com