Found a small problem........

  • Thread starter Thread starter Duncan
  • Start date Start date
D

Duncan

Hi Guys

I'm at a loss as to why this isnt working...

If Application.UserName = (my username here) Then
Unload Userform1
Else
MsgBox Application.UserName
End If


I put the msgbox bit in just in case there was a problem with my
username....it looks exactly the same as typed, i dont geddit...

any ideas anyone?

Duncan
 
Try this

If Trim(Application.UserName) = "Bob" Then
Unload UserForm1
Else
MsgBox Application.UserName
End If


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)
 
Duncan,
AFAIK, this returns the name entered when Excel/Office was first installed
i.e. the name that appears in the Help>About.. box, not necessarily your
windows username.

NickHK
 
Bob:- Many thanks the trim did make it work

Nick: - I think you are right but in this instance our users have a
generic install pattern which grabs their username from novell login,
(i dont really understand how or why but the end result is the
usernames end up the same so that is all good!)

Many thanks both,

Duncan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top