ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Logging activity (https://www.excelbanter.com/excel-programming/322169-logging-activity.html)

George Foreman

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

Jim Thomlinson[_3_]

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


Doug Glancy

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




Jim Thomlinson[_3_]

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





Doug Glancy

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







No Name

Logging activity
 
Unfortunately the username as defined by excel
is "Company Name" and says they already have the file in
use not individual which I need. Is there a way I can
find this out??

based on the windows xp login username?

Thanks
-----Original Message-----
Thanks Jim.

Doug

"Jim Thomlinson"

wrote in message
news:8179EB71-5915-438E-A919-

...
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





.



All times are GMT +1. The time now is 01:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com