ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA to Extract time that user logged onto Windows (https://www.excelbanter.com/excel-programming/443734-vba-extract-time-user-logged-onto-windows.html)

macroapa

VBA to Extract time that user logged onto Windows
 
Hi, I know how to get the name of the current user logged onto
Windows, but I'd like to extract the time that the user logged onto to
the windows session.

This must be possible, but try as I might, I just cant find anything
on the net.

Can anyone help?

Thanks

Carl Willems

VBA to Extract time that user logged onto Windows
 
Try using:

Private Declare Function GetTickCount Lib "kernel32" () As Long
myTime = GetTickCount

in myTime you'll get the elapsed time since Windows started in
milliseconds. I don't know whether it is when the machine started, or when
the user logged on, can be different when more than one user is using the
machine, you'd have to test that.

grds,
Carl

macroapa wrote in news:e67c85ef-668e-48ce-9732-
:

Hi, I know how to get the name of the current user logged onto
Windows, but I'd like to extract the time that the user logged onto to
the windows session.

This must be possible, but try as I might, I just cant find anything
on the net.

Can anyone help?

Thanks




All times are GMT +1. The time now is 04:34 PM.

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