AW: makro für benutzer einschränken
11.06.2004 12:28:40
ralf
hab das von dem link in ein modul kopiert(name des moduls=modul1):
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub Form_Load()
'KPD-Team 1998
'URL: <a href="http://www.allapi.net/">http://www.allapi.net/</a>
'E-Mail: KPDTeam@Allapi.net
Dim strTemp As String, strUserName As String
'Create a buffer
strTemp = String(100, Chr$(0))
'Create a buffer
strUserName = String(100, Chr$(0))
'Get the username
GetUserName strUserName, 100
'strip the rest of the buffer
strUserName = Left$(strUserName, InStr(strUserName, Chr$(0)) - 1)
If Application.UserName = "HRB99951" Then
'für benutzer kennung, wenn richtiger benutzer dann...
Load frmeintragen
frmeintragen.Show
End If
'Show the temppath and the username
'MsgBox "Hello " & strUserName
'MsgBox Application.UserName
End Sub
hab nun deins in arbeitsmappe kopiert, aber was bedeutet das passwortabfrage am ende :
Private Sub Workbook_Open()
call Modul1.?passwortabfrage?
End Sub