Public Sub RefList(ByVal LBx As MSForms.ListBox)
Dim R1 As Long, R2 As Long
Dim hHK1 As Long, hHK2 As Long
Dim hHK3 As Long, hHK4 As Long
Dim Row As Long, Index As Long
Dim lpPath As String, lpGUID As String
Dim lpName As String, lpDescription As String
Dim T()
Let Application.ScreenUpdating = False
Let Application.Calculation = xlCalculationManual
Call Cells.Clear
Let lpPath = String$(128, vbNullChar)
Let lpDescription = String$(128, vbNullChar)
Let lpName = String$(128, vbNullChar)
Let lpGUID = String$(128, vbNullChar)
Let R1 = RegOpenKeyEx(HKEY_CLASSES_ROOT, "TypeLib", ByVal 0&, KEY_READ, hHK1)
If R1 = ERROR_SUCCESS Then
ReDim T(1 To 3, 1 To 10000)
Do While Not R1 = ERROR_NO_MORE_ITEMS
Let R1 = RegEnumKey(hHK1, Row, lpGUID, Len(lpGUID))
If R1 = ERROR_SUCCESS Then
Let R2 = RegOpenKeyEx(hHK1, lpGUID, ByVal 0&, KEY_READ, hHK2)
If R2 = ERROR_SUCCESS Then
Let Index = 0
Do While Not R2 = ERROR_NO_MORE_ITEMS
Let R2 = RegEnumKey(hHK2, Index, lpName, Len(lpName))
If R2 = ERROR_SUCCESS Then
Call RegQueryValue(hHK2, lpName, lpDescription, Len(lpDescription))
Call RegOpenKeyEx(hHK2, lpName, ByVal 0&, KEY_READ, hHK3)
Call RegOpenKeyEx(hHK3, "0", ByVal 0&, KEY_READ, hHK4)
Call RegQueryValue(hHK4, "win32", lpPath, Len(lpPath))
Let Index = Index + 1
Let Row = Row + 1
Let T(1, Row) = lpGUID
Let T(2, Row) = lpDescription
Let T(3, Row) = lpPath
End If
Loop
End If
End If
Let Row = Row + 1
Loop
Call RegCloseKey(hHK1)
Call RegCloseKey(hHK2)
Call RegCloseKey(hHK3)
Call RegCloseKey(hHK4)
End If
ReDim Preserve T(1 To 3, 1 To Row)
LBx.List = WorksheetFunction.Transpose(T)
End Sub