Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Login date & time to the VBA application.

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Login date & time to the VBA application.

On Jul 3, 11:00 am, "Bob Phillips" wrote:
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- Hide quoted text -


- Show quoted text -



Dear Bob,

Sorry I dont understand, where I put your code, and how it works.
shall I put this code in LoginUserform or where??

Pls give me some explanation how to use your code.

Regards.

shahzad

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Employee login time sheet widman Excel Discussion (Misc queries) 2 May 17th 09 03:10 PM
How can i make time schedule sheet for login logout timmings Laxman.bolli Excel Discussion (Misc queries) 2 January 6th 09 05:39 PM
Mac issue with macro recording user login & date (run time error ' Linking to specific cells in pivot table Excel Programming 5 May 8th 07 04:52 PM
Tracking changes of login & time Ozgur Pars[_2_] Excel Programming 8 April 19th 06 05:13 PM
how do I set up an employee time in/out login kordahl Excel Programming 1 April 18th 06 12:41 PM


All times are GMT +1. The time now is 09:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"