Pull login time and windows username

B

Boss

Hi,

I already have a code which pulls windows username

Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA"
(ByVal lpBuffer As String, nSize As Long) As Long

Function UserNameWindows() As String
Dim lngLen As Long
Dim strBuffer As String

Const dhcMaxUserName = 255

strBuffer = Space(dhcMaxUserName)
lngLen = dhcMaxUserName
If CBool(GetUserName(strBuffer, lngLen)) Then
UserNameWindows = Left$(strBuffer, lngLen - 1)
Else
UserNameWindows = ""
End If

End Function


How can i also trap the login time in the excel cell... anyideas...
Please help... Thanks
Boss
 
B

Boss

Hi,

By login time i mean the windows login time and not the excel open time. Thx!

Boss
 

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