Ecxel Help Request

Soldato
Joined
6 Jan 2013
Posts
21,843
Location
Rollergirl
GD is usually great for this...

I want to add the name of the last author in a cell. I have used this VBA code to do it, but it only adds the first name "Joe" but I want to to say "Joe Bloggs".

Code:
Function LastAuthor()
LastAuthor = ActiveWorkbook.BuiltinDocumentProperties("Last Author")
End Function



In the cell I put:
Code:
=LastAuthor()
 
Soldato
Joined
23 Oct 2002
Posts
5,719
Location
Various
I can't help with your question but I would suggest changing ActiveWorkbook to ThisWorkbook. If you have another spreadsheet open your formula will display the Last author of the foreground spreadsheet not necessarily the spreadsheet the formula is in
 
Soldato
Joined
18 Oct 2012
Posts
8,333
when i've used vba before to get author details it's been linked to the office account iirc, so the name that appears will depend on whatever the user put in for that.

for example my own name would come out in full, others would be an email address etc.
 
Soldato
Joined
23 Oct 2002
Posts
5,719
Location
Various
Code:
Sub Test()
Dim WB as Workbook

Set WB = ThisWorkbook
Stop

End Sub

When the code stops use the "locals" window (you might need to switch it on from the view menu) to explore pretty much everything associated with the workbook in the WB variable.
 
Back
Top Bottom