有没有办法获取给定对象的所有有效属性的列表?
如果我想从单元格a1开始,然后向下并指定a1,a2,a3,那么让我们说一个工作表对象的所有有效属性是可以做到的吗?我找不到任何:
list = object.enumproperties
有什么想法吗?
答案 0 :(得分:17)
工具 - 参考文献 - 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