18

有没有办法获取给定对象的所有有效属性的列表?

如果我想从单元格 a1 开始,然后向下分配 a1、a2、a3,比如说工作表对象的所有有效属性,那可以做吗?我找不到:

list = object.enumproperties

有任何想法吗?

4

1 回答 1

20

工具 - 参考资料 - TypeLib Information

然后:

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
于 2013-11-05T06:47:25.447 回答