lundi 3 novembre 2014

Infinite amount of Collection VBA


Vote count:

0




Here is the screen of my problem which is infinite amount of collections. I want the collection be added to object property just once. Not like this:


http://ift.tt/1DQ5E8Z (screen showing the problem with "watch" of collection in VBA



Public Sub testCollections()

Dim index As Long
index = 1
Dim OJsonElement As JsonElement
Dim newColl As New Collection
Dim str As String
Call addColl(OJsonElement, newColl)


For Each OJsonElement In newColl
Debug.Print "THE NAME IS:" & OJsonElement.name
Next OJsonElement

End Sub


Function addColl(obj1 As JsonElement, nextCollection As Collection)
Dim i As Long
Set nextCollection = New Collection
Set obj1 = New JsonElement
Set obj1.valueCollection = nextCollection
obj1.name = "CityName"
obj1.value = "type"
nextCollection.Add obj1


'obj1.ValueType = nextCollection


'nextCollection.Add nextCollection



End Function


P.S variable str is not used.



asked 19 secs ago







Infinite amount of Collection VBA

Aucun commentaire:

Enregistrer un commentaire