Libby,
There is no way to prevent the user from changing the username in
the Options dialog. You can get the Windows logon name with code
like:
Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" ( _
ByVal lpBuffer As String, nSize As Long) As Long
Sub AAA()
Dim UName As String * 255
Dim L As Long: L = 255
Dim Res As Long
Res = GetUserName(UName, L)
UName = Left$(UName, L - 1)
Msgbox UName
End Sub
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"libby" wrote in message
...
Hi
Is there any way of preventing a user from changing the
Application.UserName via the Tools/Options/General.
I have a macro that performs certain code depending on
who's logged on.
I'm running Windows NT which people have to log onto so is
there any way Excel97 can look at that login and use that
as the username???