'Select' expression cannot be of type 'system.OperatingSystem [HELP]

  • Thread starter Thread starter JH
  • Start date Start date
J

JH

Dim SysInfo2 As System.Environment

Dim OS As String



With SysInfo2

Select Case .OSVersion

Case 4 : OS = "Win NT"

Case 5 : OS = "Win 2000"

Case 6 : OS = "Win XP"

End Select

End With
 
* "JH said:
Dim SysInfo2 As System.Environment

You want to access shared methods of 'System.Environment', you don't
need an instance variable.
With SysInfo2

Select Case .OSVersion

Case 4 : OS = "Win NT"

Case 5 : OS = "Win 2000"

Case 6 : OS = "Win XP"

You will have to select 'Environment.OSVersion.Version.Major' or any
other property of 'Version'.

\\\
Select Case Environment.OSVersion.Version.Major
Case ...
...
...
End Select
///
 
Back
Top