Есть ли способ получить информацию о DDR физической памяти, например DDR3 or DDR4
, в Excel / Access VBA.В приведенном ниже разделе приведена подробная информация о физической памяти, но нет информации о DDR.
Sub RAMDetails()
Dim oWMISrvEx As Object
Dim oWMIObjSet As Object
Dim oWMIObjEx As Object
Dim oWMIProp As Object
Dim sWQL As String
Dim n
Dim sht As Worksheet
Set sht = ThisWorkbook.Sheets("Sheet1")
sWQL = "Select * From Win32_PhysicalMemory"
Set oWMISrvEx = GetObject("winmgmts:root/CIMV2")
Set oWMIObjSet = oWMISrvEx.ExecQuery(sWQL)
intRow = 2
strRow = Str(intRow)
sht.Range("A1").Value = "Name"
sht.Cells(1, 1).Font.Bold = True
sht.Range("B1").Value = "Value"
sht.Cells(1, 2).Font.Bold = True
For Each oWMIObjEx In oWMIObjSet
For Each oWMIProp In oWMIObjEx.Properties_
If Not IsNull(oWMIProp.Value) Then
If IsArray(oWMIProp.Value) Then
For n = LBound(oWMIProp.Value) To UBound(oWMIProp.Value)
Debug.Print oWMIProp.Name & "(" & n & ")", oWMIProp.Value(n)
sht.Range("A" & Trim(strRow)).Value = oWMIProp.Name
sht.Range("B" & Trim(strRow)).Value = oWMIProp.Value(n)
sht.Range("B" & Trim(strRow)).HorizontalAlignment = xlLeft
intRow = intRow + 1
strRow = Str(intRow)
Next
Else
sht.Range("A" & Trim(strRow)).Value = oWMIProp.Name
sht.Range("B" & Trim(strRow)).Value = oWMIProp.Value
sht.Range("B" & Trim(strRow)).HorizontalAlignment = xlLeft
intRow = intRow + 1
strRow = Str(intRow)
End If
End If
Next
Next
End Sub