Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default 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" wrote in message
ups.com...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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 HelpAbout.. box, not necessarily your
windows username.

NickHK

"Duncan" wrote in message
ups.com...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
small fuction problem pass arguments ina Excel Programming 3 April 25th 06 01:25 PM
small problem PH NEWS Excel Worksheet Functions 7 March 22nd 06 07:15 PM
Vlookup data wrong if the small value found are same Fanny Excel Discussion (Misc queries) 4 January 11th 06 03:05 AM
A small problem for you but big for me! Michael Excel Discussion (Misc queries) 4 June 28th 05 06:38 AM
Problem with small()....I think Weekend user Excel Worksheet Functions 5 May 16th 05 11:21 AM


All times are GMT +1. The time now is 11:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"