My function returns an array which also have a collection (Col) as its last item:
But when I run the Sub, I get "Runtime error 1004: Application-defined or object-defined error". I understand this is due to array "temp()"s size but how can I display the temp() values properly?
Thanks!
Rustam
Code:
For Each Node In Resp.getElementsByTagName("condition")
cover = Node.Attributes.getNamedItem("cover").Text
If Not Node.Attributes.getNamedItem("base") Is Nothing Then
base = Node.Attributes.getNamedItem("base").Text
Else: base = "0"
End If
Col.Add Array(cover, base)
Next Node
funcResult = Array(data1, data2, data3, data4, Col)
But when I run the Sub, I get "Runtime error 1004: Application-defined or object-defined error". I understand this is due to array "temp()"s size but how can I display the temp() values properly?
Code:
Sub Button_Click()
Dim getData as String
Dim temp() As Variant
Dim C As Integer
Sheet1.Range("A:A").ClearContents
getData = Sheet1.Range("A1").Value
temp = funcResult(getData)
C = UBound(temp)
For i = 0 To C
Sheet1.Cells(i + 1, 1).Value = temp(i)
Next i
End Sub
Thanks!
Rustam
Last edited: