Get list of all properties for an object

前端 未结 1 909
陌清茗
陌清茗 2020-12-08 15:51

Is there a way to get a list of all valid properties for a given object?

If I wanted to start at cell a1, and go down and assign a1, a2, a3, all of the valid propert

相关标签:
1条回答
  • 2020-12-08 16:28

    Tools - References - TypeLib Information.

    Then:

    Sub DumpProperties(ByVal o As Object)
    
      Dim t As TLI.TLIApplication
      Set t = New TLI.TLIApplication
    
      Dim ti As TLI.TypeInfo
      Set ti = t.InterfaceInfoFromObject(o)
    
      Dim mi As TLI.MemberInfo, i As Long
      For Each mi In ti.Members
        i = i + 1
        ActiveSheet.Cells(i, 1).Value = mi.Name
      Next
    
    End Sub
    
    0 讨论(0)
提交回复
热议问题