Option
Explicit
Sub
SimpleExample()
Dim
objProperty
As
Object
Dim
vntCreationDate
As
Variant
Dim
vntLastSaved
As
Variant
Dim
vntLastAuthor
As
Variant
Dim
blnValid
As
Boolean
For
Each
objProperty
In
Workbooks(
"DeineMappe.xlsx"
).BuiltinDocumentProperties
If
TypeOf
objProperty
Is
DocumentProperty
Then
Select
Case
objProperty.Name
Case
"Creation date"
: vntCreationDate = objProperty.Value
Case
"Last save time"
: vntLastSaved = objProperty.Value
Case
"Last author"
: vntLastAuthor = objProperty.Value
End
Select
Else
Stop
End
If
If
Not
( _
IsEmpty(vntCreationDate) _
Or
IsEmpty(vntLastSaved) _
Or
IsEmpty(vntLastAuthor)) _
Then
blnValid =
True
Exit
For
End
If
Next
If
blnValid
Then
Debug.Print
String
$(75,
"-"
)
Debug.Print
"['Creation Date']: "
; Format$(vntCreationDate,
"yyyy-mm-dd hh:nn:ss"
)
Debug.Print
"['Last Saved']: "
; Format$(vntLastSaved,
"yyyy-mm-dd hh:nn:ss"
)
Debug.Print
"['Last Author']: "
;
"'"
; vntLastAuthor;
"'"
Else
Debug.Print
"NO_DATA_FOUND"
End
If
End
Sub