Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Alert if the travel activity is after the work activity | Excel Worksheet Functions | |||
Logging Conversations | Excel Discussion (Misc queries) | |||
Logging changes | Excel Discussion (Misc queries) | |||
Logging information | Excel Worksheet Functions | |||
Logging into a website | Excel Discussion (Misc queries) |