For the below code I am getting following error: Expected ')'
**CODE**
Set dicParentChild = CreateObject("Scripting.Dictionary")
For i = 1 To height
width = objExcel1.Application.WorksheetFunction.CountA(ob2.Columns(i))
If width > 2 Then
ReDim values(1 To (width - 2))
Key = ob2.Cells(i, 1).Value
For j = 3 To width
values(j - 2) = ob2.Cells(i, j).Value
Next j
dicParentChild.Add Key, values
End If
Next i
Can any one please help me here?
Thanks
VBScript’s arrays are zero-based. To specify the size of an array, you must use
(Re)Dim a(LastIndexToUse).(Re)Dim a(3)will create an array containing 4 slots (indices: 0, 1, 2, 3).VBA allows the specification of the first and the last index (using a
From To Tosyntax).So you must consider how many items you need, substract 1 to get the last index parameter for
(Re)Dim, and be very carefull when you compute the array indices from your cell/row/col numbers.