hi,
i have an array of 30 adgroup objects, called arrAdGroup. i am using a loop
to traverse through the array to set the adgroup.id property to a value
(which is different every time).
the code sets the value of all the objects in the array to the value of the
last object.
the code is below:
For i = 0 To counter - 1
With oKeyword
..adGroupId = adgroupID(i)
..criterionType =
criterion.com.google.adwords.CriterionType.Keyword
'.criterionTypeSpecified = True
If BidChange(i) Then
..maxCpc = Bid(i)
..maxCpcSpecified = True
End If
Select Case keywordType(i)
Case 1
..type = criterion.com.google.adwords.KeywordType.Broad
Case 2
..type = criterion.com.google.adwords.KeywordType.Exact
Case 3
..type =
criterion.com.google.adwords.KeywordType.Phrase
End Select
If DURLChange(i) Then
..destinationUrl = destinationURL(i)
End If
If paused(i) Then
..paused = True
..pausedSpecified = True
End If
..id = keywordID(i)
End With
' here is where the code is breaking.
If keywordID(i) 0 Then
arrKeyword(i) = oKeyword
End If
' every time this code executes, the previous object that was set in the
earlier 'loop is overwritten and a new instance of the object appears in the
(i) instance of 'the array.
Next
please help.