Gary, unfortunately, depending on the system (incl some Windows), you cannot
rely on environ("OS") to return anything at all.
Mike H, opsystem = Environ(13)
that "OS" relates to 13 is purely specific to your own machine
Regards,
Peter T
"Gary Keramidas" <GKeramidasATmsn.com> wrote in message
news:eS%238Ph7%(E-Mail Removed)...
> you can try this:
> environ("OS")
>
> or, somebody wrote this, can't remember who, though:
>
> Sub ListEnvioron()
> Dim Rng As Range
> Dim Ndx As Long
> Dim S As String
> Dim Pos As Long
>
> Ndx = 1
> On Error Resume Next
> Set Rng = Range("A1")
> Do While True
> S = Environ(Ndx)
> If Err.Number <> 0 Then
> Exit Do
> End If
> Pos = InStr(1, S, "=")
> Rng.Value = Left(S, Pos - 1)
> Rng(1, 2).Value = Mid(S, Pos + 1)
> Ndx = Ndx + 1
> Set Rng = Rng(2, 1)
> Loop
> End Sub
>
> --
>
>
> Gary
>
>
> "Peter T" <peter_t@discussions> wrote in message
> news:exCGEF7%(E-Mail Removed)...
>> Search "compile" and/or "conditional compilation" in VBA help
>>
>> Regards,
>> Peter T
>>
>>
>> "NateBuckley" <(E-Mail Removed)> wrote in message
>> news:FDC8036E-475F-4A83-BF84-(E-Mail Removed)...
>>> Thank you very much, just what I wanted.
>>>
>>> Your a star.
>>>
>>> If you have the time may I ask what # means? I shall go and attempt to
>>> find
>>> out what they mean from google.
>>>
>>> Thanks again
>>>
>>> "Peter T" wrote:
>>>
>>>> #If Mac Then
>>>> ' it's a Mac
>>>> #Else
>>>> ' it's not a Mac
>>>> #End If
>>>>
>>>> Regards,
>>>> Peter T
>>>>
>>>> "NateBuckley" <(E-Mail Removed)> wrote in message
>>>> news:1506E2B1-FBC0-44F5-8E8B-(E-Mail Removed)...
>>>> > Hello I've been using WinAPI calls to do some swanky stuff, but
>>>> > although
>>>> > no
>>>> > one uses Macs where I work, I'd like (if possible) to aquire the
>>>> > operating
>>>> > system information so IF Mac then don't do WinAPI calls etc. Not
>>>> > really an
>>>> > issue at the moment but always good to know just in case.
>>>> >
>>>> > Is this possible with VBA?
>>>> >
>>>> > Cheers!
>>>>
>>>>
>>>>
>>
>>
>
>
|