![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Jul 2003
Location: California
Posts: 111
|
I am trying to dictate a file path based on OS Version, but am not sure how to do it exactly. I found this code for determining the OS, and I believe it goes in a module, but how do I access the results for my CommandButton?
Any help is appreciated. Function OS_Version() As String Dim Os As OSVERSIONINFO Dim m As Long Dim MjV As Long Dim PId As Long Dim MnV As Long Os.dwOSVersionInfoSize = Len(Os) m = GetVersionEx(Os) MjV = Os.dwMajorVersion PId = Os.dwPlatformId MnV = Os.dwMinorVersion If PId = 2 Then '// NT,2000,XP Select Case Os.dwMajorVersion Case Is = 3 OS_Version = " Windows NT 3." & Os.dwMinorVersion Case Is = 4 OS_Version = " Windows NT 4 " Case Is = 5 Select Case Os.dwMinorVersion '// win 2000 Case Is = 0 OS_Version = " Windows Windows 2000 " '// win XP or win .NET server Case Is = 1 OS_Version = " Windows XP " Case Else OS_Version = " Windows .NET Server " End Select End Select End If If PId = 1 Then If MnV = 10 Then OS_Version = " Windows 98 " If MnV = 0 Then OS_Version = " Windows 95 " If MnV = 90 Then OS_Version = " Windows ME " End If End Function |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|