Excel 2010 VBA创builddate
如何在Excel 2010中使用VBA获取当前工作簿文件的创builddate? 我浏览了ThisWorkBook的所有属性,我似乎没有find那里的东西。
MsgBox ActiveWorkbook.BuiltinDocumentProperties("Creation Date") 'Output: 25.07.2011 14:51:11
这适用于Excel 2003,没有2010来testing它。 链接到Office 2010的MSDN Doc ,还有一个列表,其中还有其他可用的属性。
使用
ActiveWorkbook.BuiltinDocumentProperties.Item("Creation date").Value
要列出所有属性,请运行此macros
Public Sub listProperties() rw = 1 Worksheets(1).Activate For Each p In ActiveWorkbook.BuiltinDocumentProperties Cells(rw, 1).Value = p.Name On Error Resume Next Cells(rw, 2).Value = p.Value rw = rw + 1 Next End Sub
使用Scripting.FileSystemObject
Dim oFS As Object Dim creationDate As String Set oFS = CreateObject("Scripting.FileSystemObject") creationDate = oFS.GetFile(ThisWorkbook.FullName).DateCreated