Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Pull login time and windows username


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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Pull login time and windows username


Hi,

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

Boss

"Boss" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Pull login time and windows username


I found an example showing how to gather user information on Karl Peterson's
site:

http://vb.mvps.org/samples/NetUser/

Might require some tweaking for your purposes.

HTH,

Eric

"Boss" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Pull login time and windows username


Here's a nice long thread discussing the topic:

http://www.eggheadcafe.com/software/...ime-of-th.aspx

"Boss" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Pull login time and windows username


Thanks a lot for your hepl... i would probably solved the issue now... Thx!

"EricG" wrote:

Here's a nice long thread discussing the topic:

http://www.eggheadcafe.com/software/...ime-of-th.aspx

"Boss" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
login username Ranjit kurian Excel Programming 2 June 6th 08 05:39 PM
login username Ranjit kurian Excel Programming 8 June 6th 08 12:50 PM
username and password when login Ranjit kurian Excel Programming 1 May 23rd 08 10:05 AM
Find the login time of the current Windows user Ivyleaf Excel Programming 2 March 29th 08 06:11 AM
Username and password login. Moh Excel Programming 10 December 21st 07 03:36 PM


All times are GMT +1. The time now is 09:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"