View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_5_] Jim Thomlinson[_5_] is offline
external usenet poster
 
Posts: 486
Default Getting Users Name

Have you tried using environ("UserName") something like this (instead of the
API)

msgbox environ("UserName")

Not to sure why the API would fail but it would have more to do with the
Operating system than Excel...
--
HTH...

Jim Thomlinson


"fastmonkey512" wrote:


Hi all

I've used a bit of code from the M$ site that grabs the users name
using a windows API

The code is from here http://support.microsoft.com/?kbid=161394

There are about 10 people who all use this spreadsheet and everything
works fine, but on 1 PC it does not get the user name and it doesn't
matter who logs in

Has anyone else used that bit of code before, and seen this happen.

All it seems to do it leave the Var LpName with 256 spaces and no
name.


--
fastmonkey512
------------------------------------------------------------------------
fastmonkey512's Profile: http://www.excelforum.com/member.php...o&userid=23982
View this thread: http://www.excelforum.com/showthread...hreadid=511253