#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Environ()

Is there anywhere I can find a list of the Environment numbers I can use
with the Environ statement. like Environ(13) gives me the number of
Processors.

I have seach the VBA help wih no luck so far.

Jan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Environ()

I have to add, that I have created the list myself, i just wondered if it
could be found anyywhere

Jan

"Jan Kronsell" skrev i en
meddelelse ...
Is there anywhere I can find a list of the Environment numbers I can use
with the Environ statement. like Environ(13) gives me the number of
Processors.

I have seach the VBA help wih no luck so far.

Jan




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Environ()

Jan,

There is no set list as it will depend upon what environment variables have
been set on each particular machine.

Here is some code to print it all out

Dim iLoop As Long

iLoop = 1
Do
Debug.Print "#" & Format(iLoop, "00") & " " & Environ(iLoop)
iLoop = iLoop + 1
Loop Until Environ(iLoop) = ""


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jan Kronsell" wrote in message
...
I have to add, that I have created the list myself, i just wondered if it
could be found anyywhere

Jan

"Jan Kronsell" skrev i en
meddelelse ...
Is there anywhere I can find a list of the Environment numbers I can use
with the Environ statement. like Environ(13) gives me the number of
Processors.

I have seach the VBA help wih no luck so far.

Jan






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default A Environ()

Hi Bob

Thanks. I made the list myself using similar code to yours. I just wondered
if a list of possible values to be checked for existed.

Jan

"Bob Phillips" skrev i en meddelelse
...
Jan,

There is no set list as it will depend upon what environment variables

have
been set on each particular machine.

Here is some code to print it all out

Dim iLoop As Long

iLoop = 1
Do
Debug.Print "#" & Format(iLoop, "00") & " " & Environ(iLoop)
iLoop = iLoop + 1
Loop Until Environ(iLoop) = ""


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jan Kronsell" wrote in message
...
I have to add, that I have created the list myself, i just wondered if

it
could be found anyywhere

Jan

"Jan Kronsell" skrev i en
meddelelse ...
Is there anywhere I can find a list of the Environment numbers I can

use
with the Environ statement. like Environ(13) gives me the number of
Processors.

I have seach the VBA help wih no luck so far.

Jan








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Environ()

The Environ "list" can be referenced by number so you can check the list
from start to finish.

You can also check for the environment variable by name directly:
eg. MsgBox Environ("NUMBER_OF_PROCESSORS")


This code checks for the existence of the environment variable
Sub test()
Dim blnExists As Boolean, strSearch As String
strSearch = "NUMBER_OF_PROCESSORS"

blnExists = (Environ(strSearch) < "")

MsgBox blnExists
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Jan Kronsell" wrote in message
...
Hi Bob

Thanks. I made the list myself using similar code to yours. I just

wondered
if a list of possible values to be checked for existed.

Jan

"Bob Phillips" skrev i en meddelelse
...
Jan,

There is no set list as it will depend upon what environment variables

have
been set on each particular machine.

Here is some code to print it all out

Dim iLoop As Long

iLoop = 1
Do
Debug.Print "#" & Format(iLoop, "00") & " " & Environ(iLoop)
iLoop = iLoop + 1
Loop Until Environ(iLoop) = ""


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jan Kronsell" wrote in message
...
I have to add, that I have created the list myself, i just wondered if

it
could be found anyywhere

Jan

"Jan Kronsell" skrev i en
meddelelse ...
Is there anywhere I can find a list of the Environment numbers I can

use
with the Environ statement. like Environ(13) gives me the number of
Processors.

I have seach the VBA help wih no luck so far.

Jan












  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Environ()

Thanks!

Jan

"Rob van Gelder" skrev i en
meddelelse ...
The Environ "list" can be referenced by number so you can check the list
from start to finish.

You can also check for the environment variable by name directly:
eg. MsgBox Environ("NUMBER_OF_PROCESSORS")


This code checks for the existence of the environment variable
Sub test()
Dim blnExists As Boolean, strSearch As String
strSearch = "NUMBER_OF_PROCESSORS"

blnExists = (Environ(strSearch) < "")

MsgBox blnExists
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Jan Kronsell" wrote in message
...
Hi Bob

Thanks. I made the list myself using similar code to yours. I just

wondered
if a list of possible values to be checked for existed.

Jan

"Bob Phillips" skrev i en meddelelse
...
Jan,

There is no set list as it will depend upon what environment variables

have
been set on each particular machine.

Here is some code to print it all out

Dim iLoop As Long

iLoop = 1
Do
Debug.Print "#" & Format(iLoop, "00") & " " & Environ(iLoop)
iLoop = iLoop + 1
Loop Until Environ(iLoop) = ""


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jan Kronsell" wrote in

message
...
I have to add, that I have created the list myself, i just wondered

if
it
could be found anyywhere

Jan

"Jan Kronsell" skrev i en
meddelelse ...
Is there anywhere I can find a list of the Environment numbers I

can
use
with the Environ statement. like Environ(13) gives me the number

of
Processors.

I have seach the VBA help wih no luck so far.

Jan












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
Including Environ Username in Cell swieduwi Excel Worksheet Functions 9 March 30th 06 04:43 PM
Environ()- help DJ Excel Programming 2 November 13th 03 06:26 AM
Have a list of Environ variables? Scott Warren Excel Programming 2 September 15th 03 06:08 PM


All times are GMT +1. The time now is 02:13 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"