+ Reply to Thread
Results 1 to 6 of 6

Logging activity

  1. #1
    George Foreman
    Guest

    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. #2
    Jim Thomlinson
    Guest

    RE: 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. #3
    Doug Glancy
    Guest

    Re: Logging activity

    George,

    Another way to insert the username:

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

    hth,

    Doug Glancy

    "George Foreman" <anonymous@discussions.microsoft.com> wrote in message
    news:01f001c508a3$efc8c190$a401280a@phx.gbl...
    > 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. #4
    Jim Thomlinson
    Guest

    Re: 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" <anonymous@discussions.microsoft.com> wrote in message
    > news:01f001c508a3$efc8c190$a401280a@phx.gbl...
    > > 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. #5
    Doug Glancy
    Guest

    Re: Logging activity

    Thanks Jim.

    Doug

    "Jim Thomlinson" <JimThomlinson@discussions.microsoft.com> wrote in message
    news:8179EB71-5915-438E-A919-94C69A46AC8E@microsoft.com...
    > 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" <anonymous@discussions.microsoft.com> wrote in message
    > > news:01f001c508a3$efc8c190$a401280a@phx.gbl...
    > > > 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

    > >
    > >
    > >




  6. #6
    Guest

    Re: 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"

    <JimThomlinson@discussions.microsoft.com> wrote in message
    >news:8179EB71-5915-438E-A919-

    94C69A46AC8E@microsoft.com...
    >> 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"

    <anonymous@discussions.microsoft.com> wrote in message
    >> > news:01f001c508a3$efc8c190$a401280a@phx.gbl...
    >> > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1