That's actually not that easy to do.
 
The problem is that you're dealing with Windows Events.
Many Windows events (login, screen locking, etc) write to a system log.
but many of these are set up by the workstation "Policies".
 
The policies are handled by the network system administrator.
 
Depending on the size of your organization, and how friendly and capable your 
I.T. admin is, you may or may not be able to get this done!
 
in addition, the standard Windows event logs are on the individual workstation.
To get access to them your network has to allow you to connect to the 
individual workstation.
 
I spent about two weeks working on a method that did not require Policy changes 
and was unable to accomplish it (reliably)
 
The best I could do is:
 - Create an event log file
 - Create VB Script that writes to the log file when user logs in (placed in 
startup folder)
 - Create VB Script that writes to the log file and locks the screen
 - Create VB Script that writes to the log file when user clicks icon after 
unlocking the screen (manual process!)
 - Create VB Script that writes to the log file and logs off (instead of user 
logs off or powers down)
 
then, your Excel application can read the event log.


If someone else has another approach, I'd be pleased to hear abou it!!!

Paul
-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
-----------------------------------------

 From: sunil patil <[email protected]>
>To: [email protected] 
>Sent: Thursday, June 19, 2014 10:31 AM
>Subject: $$Excel-Macros$$ Need VBA code to track log off and log on Time
>  
>
>
>Hi All, 
>
>Can you provide me vba code to track when any user lock the system, time shoud 
>start tracking in one excel sheet when user relogin . the final output shoud 
>be logg off time to login time., 
>
>E.g suppose user lock the computer by 6:30 and log in after 6:45, time shoud 
>be calculated as 15 minutes would be break time. 
>
>
>Can you please provide me the vba code as i am handling 40 members team need 
>to track break of all people and how much time they spend on floor. 
>
>Your help would much appriciated.
>
-- 
>Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
>=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
>https://www.facebook.com/discussexcel
> 
>FORUM RULES
> 
>1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
>Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
>quick attention or may not be answered.
>2) Don't post a question in the thread of another member.
>3) Don't post questions regarding breaking or bypassing any security measure.
>4) Acknowledge the responses you receive, good or bad.
>5) Jobs posting is not allowed.
>6) Sharing copyrighted material and their links is not allowed.
> 
>NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
>members are not responsible for any loss.
>--- 
>You received this message because you are subscribed to the Google Groups "MS 
>EXCEL AND VBA MACROS" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to [email protected].
>To post to this group, send email to [email protected].
>Visit this group at http://groups.google.com/group/excel-macros.
>For more options, visit https://groups.google.com/d/optout.
>
>
>    

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to