Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. Dim fs As Object
  2. Set fs = CreateObject("Scripting.FileSystemObject")
  3. Dim folder As Object
  4. Set folder = fs.GetFolder(ThisWorkbook.path)
  5. Dim file As Object
  6. Dim sKey As String
  7. Dim fileDate As Date
  8.  
  9. For Each file In folder.Files
  10. If file.DateCreated > fileDate Then
  11. fileDate = file.DateCreated
  12. 'sKey = file.Name // this works but I want next line instead
  13. sKey = file.BuiltinDocumentProperties("Keywords").Value // Error is here
  14. End If
  15. Next file
  16.  
  17. MsgBox ThisWorkbook.BuiltinDocumentProperties("Keywords").Value
  18.  
  19. Dim wb As Workbook
  20. Set wb = Workbooks.Open(filename:=file.Name, ReadOnly:=True)
  21. skey = wb.BuiltinDocumentProperties("Keywords").Value
  22. wb.Close (False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement