Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Logging activity

People will use my spreadsheet at work on a network
drive. If someone uses the sheet can I log their windows
xp pro username and the date and time in a hidden sheet
for me to review?

Maybe a step further is to log all keystrokes A-Z and 0-9
for any entrys in the past 48 hours! This would
eliminate the file from going huge as there would only
ever be in 48 hours around 1000 words or numbers ever
entered.

Hope you can give me some help on this one :-

Regards and thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Logging activity

Here is the user name code...

Option Explicit


'-----------------------------------------------------------------------------------------------------
' This module only provides the username.
'================================================= ================================================== ==


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


Public Function ReturnNTUserName() As String

' Returns the NT Domain User Name

Dim rString As String * 255, sLen As Long, tString As String
Dim NWUserName As String

tString = ""

On Error Resume Next
sLen = GetUserName(rString, 255)
sLen = InStr(1, rString, Chr(0))
If sLen 0 Then
tString = Left(rString, sLen - 1)
Else
tString = rString
End If
On Error GoTo 0

NWUserName = Left(Right(tString, Len(tString) - 1), Len(tString) - 2)
ReturnNTUserName = UCase(Left(tString, 1)) + NWUserName +
Right(UCase(tString), 1)

End Function

As for logging in a hidden sheet, that will work but you might be better off
with a database such as access than the hidden sheet. Saves the whole problem
with purging. Also if you end up with more than 1 copy of the spread sheet
you will have to check 2 different sheets in 2 different files... One access
database would be my preference. I have code for an ODBC Connection. You can
just use the on open and on close events to track entry and exit from the
sheet...

HTH

"George Foreman" wrote:

People will use my spreadsheet at work on a network
drive. If someone uses the sheet can I log their windows
xp pro username and the date and time in a hidden sheet
for me to review?

Maybe a step further is to log all keystrokes A-Z and 0-9
for any entrys in the past 48 hours! This would
eliminate the file from going huge as there would only
ever be in 48 hours around 1000 words or numbers ever
entered.

Hope you can give me some help on this one :-

Regards and thanks in advance

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Logging activity

George,

Another way to insert the username:

Worksheets("Sheet1").Range("A1") = Application.UserName

hth,

Doug Glancy

"George Foreman" wrote in message
...
People will use my spreadsheet at work on a network
drive. If someone uses the sheet can I log their windows
xp pro username and the date and time in a hidden sheet
for me to review?

Maybe a step further is to log all keystrokes A-Z and 0-9
for any entrys in the past 48 hours! This would
eliminate the file from going huge as there would only
ever be in 48 hours around 1000 words or numbers ever
entered.

Hope you can give me some help on this one :-

Regards and thanks in advance



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Logging activity

That will give you their user name as defined by Excel, not their windows
login name. It may or may not work for you depending on what you want but it
will in all likelyhood vary from their windows login name...


"Doug Glancy" wrote:

George,

Another way to insert the username:

Worksheets("Sheet1").Range("A1") = Application.UserName

hth,

Doug Glancy

"George Foreman" wrote in message
...
People will use my spreadsheet at work on a network
drive. If someone uses the sheet can I log their windows
xp pro username and the date and time in a hidden sheet
for me to review?

Maybe a step further is to log all keystrokes A-Z and 0-9
for any entrys in the past 48 hours! This would
eliminate the file from going huge as there would only
ever be in 48 hours around 1000 words or numbers ever
entered.

Hope you can give me some help on this one :-

Regards and thanks in advance




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Logging activity

Thanks Jim.

Doug

"Jim Thomlinson" wrote in message
...
That will give you their user name as defined by Excel, not their windows
login name. It may or may not work for you depending on what you want but

it
will in all likelyhood vary from their windows login name...


"Doug Glancy" wrote:

George,

Another way to insert the username:

Worksheets("Sheet1").Range("A1") = Application.UserName

hth,

Doug Glancy

"George Foreman" wrote in message
...
People will use my spreadsheet at work on a network
drive. If someone uses the sheet can I log their windows
xp pro username and the date and time in a hidden sheet
for me to review?

Maybe a step further is to log all keystrokes A-Z and 0-9
for any entrys in the past 48 hours! This would
eliminate the file from going huge as there would only
ever be in 48 hours around 1000 words or numbers ever
entered.

Hope you can give me some help on this one :-

Regards and thanks in advance








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
Alert if the travel activity is after the work activity Go Bucks!!! Excel Worksheet Functions 3 September 11th 09 05:44 PM
Logging Conversations Rugby Stud Excel Discussion (Misc queries) 1 June 19th 09 11:32 PM
Logging changes SPISO Excel Discussion (Misc queries) 0 May 12th 09 05:44 PM
Logging information SPISO Excel Worksheet Functions 0 April 22nd 09 02:16 PM
Logging into a website Jackblack1 Excel Discussion (Misc queries) 0 May 31st 06 05:27 PM


All times are GMT +1. The time now is 06:14 AM.

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

About Us

"It's about Microsoft Excel"