View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Environ function.

Environ is a function, so it has not properties and methods

You can do this to see what is available

Sub AA()
i = 1
Do While Environ(i) < ""
Debug.Print Environ(i)
i = i + 1
Loop
End Sub

this produces output like

TEMP=C:\DOCUME~1\OgilvyTW\LOCALS~1\Temp
TMP=C:\DOCUME~1\OgilvyTW\LOCALS~1\Temp
USERDOMAIN=XXXX
USERNAME=OgilvyTW
USERPROFILE=C:\Documents and Settings\OgilvyTW

so now I see I can get the username by doing

msgbox environ("Username")

--
Regards,
Tom Ogilvy




"DaveO" wrote in message
...
Looking for some help on Environ.

Need to know more about the methods and properties it has so I can see

what
I can do.

Ultimately (at this early stage) trying to get the logged on username of

the
current user for validation purposes.

Any ideas??