+ Reply to Thread
Results 1 to 4 of 4

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

  1. #1
    Duncan
    Guest

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

    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


  2. #2
    Bob Phillips
    Guest

    Re: Found a small problem........

    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" <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >




  3. #3
    NickHK
    Guest

    Re: Found a small problem........

    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

    "Duncan" <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >




  4. #4
    Duncan
    Guest

    Re: Found a small problem........

    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


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1