David,
If you're on a network and if all your users have network
ids then this should work:
'Goes at the top of the module.
Declare Function GetUserName Lib "advapi32.dll"
Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As
Long) As Long
Then get the id with:
Public Function GetCurrentUserName() As String
Dim lpBuff As String * 25
Dim ret As Long, Username As String
On Error GoTo Err_GetCurrentUserName
ret = GetUserName(lpBuff, 25)
'Username is global in scope.
Username = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
GetCurrentUserName = Username & ""
Exit_GetCurrentUserName:
Exit Function
Err_GetCurrentUserName:
MsgBox Err.Description
Resume Exit_GetCurrentUserName
End Function
Call GetCurrentUserName in the Workbook_Open event. Match
the name up to some hidden list. There's no prompting to
this call. No password either, though. If you want to get
that fancy and professional-looking, then yes, use a form.
If you're not on a network, make a logon form and match to
your hidden list.
The API call just saves the user from entering an id.
Geof.
-----Original Message-----
Hi Geof,
Actually, my question was how to create different logins
for different
people - they won't access it concurrently.
Is there a built-in way, or do I have to pop up a form to
ask for it?
Thanks!
David
--
hay7777
----------------------------------------------------------
--------------
hay7777's Profile: http://www.excelforum.com/member.php?
action=getinfo&userid=15066
View this thread:
http://www.excelforum.com/showthread...hreadid=266937
.