I'm creating a Variant Array to populate the required data, but when passing it through to the Esendex SOAP service I'm getting a message structure error. Is it not just a 2D array with 5 columns? (Originator,Recipient,Body,Type,Validity Period)
- Code: Select all
Range("A65536").End(xlUp).Select
iLastRow = ActiveCell.Row
Range("A1").Select
i = -1
For Each rRowData In Range("A2:A" & iLastRow)
i = i + 1
ReDim Preserve vMessages(0 To 4, 0 To i)
vMessages(0, i) = "Originator" ' Originator
vMessages(1, i) = Range("A" & rRowData.Row).Value ' Recipient
vMessages(2, i) = Range("B" & rRowData.Row).Value ' Body
vMessages(3, i) = "Text" ' Type
vMessages(4, i) = 6 ' Validity Period
Next rRowData
