excel vba - VBA BuiltInDocumentProperties -
i have macro sits in workbooka , retrieves data workbookb. want return "last save time" workbookb , put cell within workbooka. in code below "lastsave" named range referring cell in workbooka.
i have tried following various websites , similar questions no avail. suspect solution has objects, items in list, values, etc. cannot seem put finger on it.
1) error: object doesn't support property or method
dim lastsavetime object set lastsavetime = workbooks(b).builtindocumentproperties("last save time") workbooks(a).sheet1.range("lastsave").value = lastsavetime
2) error: automation error, unspecified error
dim lastsavetime variant set lastsavetime = workbooks(b).builtindocumentproperties("last save time") workbooks(a).sheet1.range("lastsave").value = lastsavetime
3) error: method 'value' of object 'documentproperty' failed
workbooks(a).sheet1.range("lastsave").value = workbooks(b).builtindocumentproperties("last save time").value
4) error: object doesn't support property or method
workbooks(a).sheet1.range("lastsave").value = workbooks(b).builtindocumentproperties("last save time").value
5) error: method 'value' of object 'documentproperty' failed
dim propertylist documentproperties set propertylist = workbooks(b).builtindocumentproperties workbooks(a).sheet1.range("lastsave").value = (propertylist.item("last save time"))
assuming workbook b opened, works module in workbook a.
thisworkbook.names("lastsave").referstorange.value = workbooks(b).builtindocumentproperties("last save time").value
Comments
Post a Comment