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 properties for let's say a worksheet object for example, is that something that can be done? I can't find any:
list = object.enumproperties
Any ideas?
getOwnPropertyNames() The Object. getOwnPropertyNames() method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object.
Use Python's vars() to Print an Object's Attributes The dir() function, as shown above, prints all of the attributes of a Python object.
To get the object properties, the Get-member cmdlet is used in PowerShell. Specify a cmdlet, use the pipeline operator, and then type the Get-Member cmdlet to see all of the properties available from the specified command.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With