Last Author and Date with a twist

jasperuk

New Member
Joined
Jan 11, 2017
Messages
4
Hi

I have mastered getting the last author and date from the fileA i have open my master file but i would also like to pull the author and date from another file i have open at the same time, my data input file to see when the last time the data input file was updated.

at the moment i am using these and only works for the file i am in


Function getLastModifiedUser()
getLastModifiedUser = ActiveWorkbook.BuiltinDocumentProperties("Last Author")
End Function
Function LastModified() As Date
LastModified = ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
End Function


Any Help i presume i need to change from Activeworkbook ???

Gavin
 

Tom Schreiner

Well-known Member
Joined
Mar 18, 2002
Messages
6,867
I think:
Workbooks("MyOtherWorkbookName.xlsx").BuiltinDocumentProperties("Last Author")
Try it out and let me know if it works.
Have a nice day!
 

jasperuk

New Member
Joined
Jan 11, 2017
Messages
4
I think:
Workbooks("MyOtherWorkbookName.xlsx").BuiltinDocumentProperties("Last Author")
Try it out and let me know if it works.
Have a nice day!
Morning

Thanks for the code the only problem is it only works when the other file is open, can I get the info from a saved file that could be open or closed ?

Gavin
 

Tom Schreiner

Well-known Member
Joined
Mar 18, 2002
Messages
6,867
Sure. You could write several functions in VBA to determine if the workbook is already open within the calling instance. If it is open, grab the property. If not, open the workbook silently, fetch your property, and close it.


However, I'm betting that there is a way to grab it from the XML file by way of the OpenDocument format. I don't have time to look into it right now. Maybe search on 'OpenDocument format BuiltinDocumentProperties'. Let me know if you find anything. In any case, we can solve your problem.


Have a good one!
 

Forum statistics

Threads
1,085,834
Messages
5,386,220
Members
401,986
Latest member
crt54

Some videos you may like

This Week's Hot Topics

Top