tags:

views:

753

answers:

2
+3  Q: 

Environ for vba

I am looking for so good information or code examples of the environ function for vba to grab the username on the current system.

+7  A: 

Environ() gets you the value of any environment variable. These can be found by doing the following command in the Command Prompt:

set

If you wanted to get the username, you would do:

Environ("username")

If you wanted to get the fully qualified name, you would do:

Environ("userdomain") & "\" & Environ("username")
Eric
that was exactly what I was looking for, just a little help getting started, thank you.
gary A.K.A. G4
Fantastic, glad I could help!
Eric
Don't forget that Environ is one of the functions blocked in Sandbox mode: http://office.microsoft.com/en-us/access/HP010447361033.aspx
Remou
+2  A: 
Oorang