Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
my office is currently using Windows NT, but within months Windows XP will be used. I've made a timewokbook and want to protect it in such a way that only I or the employee can open it. My idea is a) All employees have his/her own genuine server user_name. I want to use this in a verification test. b) I'm the section leader and shall have right of admission to all timeworkbooks. My server user_name should be entered in cell A1 in Sheet1 in all timeworkbooks. Each time I try to open the timeworkbook from my own computer, a macro should compare the value entered in cell A1 with the server user_name entered in the login window when the computer is restarted every day. c) The server user_name for each employee should be entered in cell B1 in Sheet1, and only in the file he/she use. The macro should compare the value entered in cell B1 with the ser user_name entered in the login window when the computer is restarted every day. The purpose is that he/she should not be allowed to open the timeworkbook belonging to other employees. Could this be done? Sincerely Andy-s |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mr. Erlandsend's site:
http://www.erlandsendata.no/english/vba/os/index.php has code for username and computer name. --------------- Another example From: Trevor Shuttleworth ) Subject: Code to show login name Newsgroups: microsoft.public.excel.programming Date: 2001-01-16 12:54:01 PST Private Declare Function apiGetUserName Lib "advapi32.dll" _ Alias "GetUserNameA" (ByVal lpBuffer As String, nsize As Long) As Long Sub GetUserNameTest() MsgBox fOSUserName End Sub Function fOSUserName() As String ' Returns the network login name Dim lngLen As Long, lngX As Long Dim strUserName As String strUserName = String$(254, 0) lngLen = 255 lngX = apiGetUserName(strUserName, lngLen) If lngX < 0 Then fOSUserName = Left$(strUserName, lngLen - 1) Else fOSUserName = "" End If End Function ------------------- Regards, Tom Ogilvy Andy Smith wrote in message om... Hi, my office is currently using Windows NT, but within months Windows XP will be used. I've made a timewokbook and want to protect it in such a way that only I or the employee can open it. My idea is a) All employees have his/her own genuine server user_name. I want to use this in a verification test. b) I'm the section leader and shall have right of admission to all timeworkbooks. My server user_name should be entered in cell A1 in Sheet1 in all timeworkbooks. Each time I try to open the timeworkbook from my own computer, a macro should compare the value entered in cell A1 with the server user_name entered in the login window when the computer is restarted every day. c) The server user_name for each employee should be entered in cell B1 in Sheet1, and only in the file he/she use. The macro should compare the value entered in cell B1 with the ser user_name entered in the login window when the computer is restarted every day. The purpose is that he/she should not be allowed to open the timeworkbook belonging to other employees. Could this be done? Sincerely Andy-s |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Not your usual password question! | Excel Discussion (Misc queries) | |||
VBA Password Question | Excel Worksheet Functions | |||
how to automate opening a password protected excel file? e.g. a .xls that has a password set in the security tab. | Excel Worksheet Functions | |||
Password Loop question. | Excel Discussion (Misc queries) | |||
bypass password when update linking of password protected file | Excel Discussion (Misc queries) |