有没有一种方法来获取给定对象的所有有效属性的列表?

如果我想从单元格a1开始,然后向下分配a1,a2,a3,那么对于一个有效的属性,例如一个工作表对象,是否可以做些什么?我找不到:

list = object.enumproperties


有任何想法吗?

最佳答案

工具-参考-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

09-04 02:41