Last modified user

L

linglc

Does anyone know how I can return the user name who last modified a file via
VB codes in a spreadsheet?
 
B

Bob Phillips

'-----------------------------------------------------------------
Function DocProps(prop As String)
'-----------------------------------------------------------------
Application.Volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

and use

MsgBox DocProps("last author")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
G

Gregg Roberts

Hi Bob,

I need something like this -- the "Last Modified By" or "Last Author" value
-- but for a given file in a folder without opening it in Excel, and
regardless of what kind of file it is. The FileSystemObject doesn't seem to
support this, crazy as it seems. I've checked the properties of the File
object in Excel VBA Help and it doesn't seem to have anything that matches
this. I've bound the MS Scripting Runtime reference and tried:

LastModBy = FileItem.LastModified
LastModBy = FileItem.LastModifiedBy
LastModBy = FileItem.ModifiedBy
LastModBy = FileItem.Modified
LastModBy = FileItem.LastAuthor
LastModBy = FileItem.Author

All of them fail as soon as I try to step through.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top