Getting Username from a file Part 2

P

pikapika13

I received the response below. After testing it out..I can't get th
username of a specific file in a folder. I only get the username o
myself.

*******************************

I use

RunUser = Environ("username")

This will pull the username they use to sign into their laptop.

I wish to get the "last modified" and the user who modified a file.
This is what I have:

Sub GetAttributes()
LM = FileDateTime("C:\blAH BLAH BLAH.xls")
Range("A1") = LM
End Sub

Can someone help me with the username piece? Much appreciated.
http://www.excelforum.com/showthread...hreadid=56118
 
B

Bob Phillips

Try this

'-----------------------------------------------------------------
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 enter in a cell such as
=DocProps ("last author")
or
=DocProps ("last save time")


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
E

erikrthorne

Sorry, misunderstood your question... you are correct that will give
you the name of ther person currently using your application...it won't
pull the name of ther person on the file...I'll have to research a
little to do your scenario...sorry about that.
 

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