TroyMcClure72
MIS
...as well as resolution etc from vba?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" _
(lpVersionInformation As OSVERSIONINFO) As Long
Public Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Public Function GetWindowsVersion() As String
' Purpose: Find Windows version
On Error GoTo ErrHandler
Dim strOSName As String
Dim OSInfo As OSVERSIONINFO
OSInfo.dwOSVersionInfoSize = 148
OSInfo.szCSDVersion = Space$(128)
' API call to get operating system info.
Call GetVersionEx(OSInfo)
With OSInfo
Select Case .dwPlatformId
Case 1
Select Case .dwMinorVersion
Case 0
strOSName = "Windows 95"
Case 10
strOSName = "Windows 98"
Case 90
strOSName = "Windows Millennium"
End Select
Case 2
Select Case .dwMajorVersion
Case 3
strOSName = "Windows NT 3.51"
Case 4
strOSName = "Windows NT 4.0"
Case 5
If .dwMinorVersion = 0 Then
strOSName = "Windows 2000"
Else
strOSName = "Windows XP"
End If
End Select
Case Else
strOSName = "Failed"
End Select
End With
GetWindowsVersion = strOSName
ExitHere:
Exit Function
ErrHandler:
Debug.Print Err, Err.Description
Resume ExitHere
End Function