View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Login date & time to the VBA application.

It is simple to write to a log file

Private Sub LogDetailsIn()
Const LOG_FILENAME As String = "LogFile.txt"
Dim iFile As Long

iFile = FreeFile
Open ThisWorkbook.Path & "\" & LOG_FILENAME For Append As #iFile
Print #iFile, envirn("Username") & " logged in at " & _
Format(Now, "dd-mmm-yyyy hh:mm:ss")
Close #iFile
End Sub

then a similar routine when closing the task.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
ups.com...
Hi,

I am new in VBA, I am developing a small program in Excel using some
Userforms and controls. I want to prepare a log sheet for in my vba
program shows the Login time and date, every time when the user load
the data base. and it note the start time and close time of the
database.

is it possible, and I want to know the username also, who use the
database and what time he used.

I prepared one userform for Login and Password procedure for different
users, with different access rights.

Pls help me in this regard. Thanks in advance.

Shahzad
Madinah