Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Envronment Variables

Status
Not open for further replies.

HorseGoose

Programmer
Apr 24, 2003
40
GB
As I am having a useful afternoon this maybe helpful too

lists environment variables specific to any PC the workbook is opened on. useful is you want to write algoritims to secure your application for particular users or even for particular pcs.

ONLY WORKS UNDER WINDOWS NOT FOR MACS (havent tested on macs to tell the truth)

Sub auto_open()
Row = 1
varindex = 1
Range("$A" & Row) = "Environ ID"
Range("$B" & Row) = "Environ Decription"
Do While Row < 200
outputstr = Environ(varindex)
Range(&quot;$A&quot; & Row) = varindex
Range(&quot;$B&quot; & Row) = outputstr
varindex = varindex + 1
Row = Row + 1
Loop
End Sub
 
I'd give you a star 'cos it is useful but you must've missed my post a few weeks ago that did exactly the same thing:
Sub env()
Dim EnvString As String
Indx = 1
Do
EnvString = Environ(Indx)
Cells(Indx, 1) = EnvString
Indx = Indx + 1
Loop Until EnvString = &quot;&quot;
End Sub

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
good idea Frederico - and done !!

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Bugger!!!

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top