SendMessageBatch in Excel

Help with the Esendex API

SendMessageBatch in Excel

Postby frolicols » Fri Jun 10, 2011 12:02 pm

I've successfully used Excel to consume the Esendex SOAP service for things such as GetMessages, SendMessagesMultipleRecipients etc, but I'm struggling with the messages array in SendMessageBatch.

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
frolicols
 
Posts: 2
Joined: Mon Aug 23, 2010 1:23 pm

Return to API



cron
© Esendex Ltd 2010
Company Registration Number: 04217280