excel批量提取文件的作者和最后的保存者

Sub xixixixi()
Dim dDate As DocumentProperty
Dim wb As Workbook
Dim str As String

For i = 1 To 2
str = Sheet1.Cells(i, 3)


Set wb = GetObject(ThisWorkbook.Path & "\" & str)

Set dDate = wb.BuiltinDocumentProperties("Author")
Sheet1.Cells(i, 1) = dDate.Value

Set dDate = wb.BuiltinDocumentProperties("Last Author")
Sheet1.Cells(i, 2) = dDate.Value

Next
End Sub

 

第三列为文件名,第一列为作者名,第二列为最后的保存者

文件名可以用cmd获取

dir /b >name.txt

上面语句保存为.bat然后运行可得到文件名列表

posted @ 2020-07-24 15:07  龙7龙  阅读(1098)  评论(0编辑  收藏  举报