-2

I have been uploading xml to Tally.ERP 9 via Excel VBA. I want to know if it's possible to upload xml to multiple tally companies at once or Not?

My excel data looks like this

Date Ledger(cr) Ledger(dr) Amount Narration Company
28/12/2021 Zeebank Bank Charges 450 Bank Charges for Dec ABC
27/12/2021 IntBank ODfee 750 Bank Charges for Dec XYZ
30/12/2021 AfriBank MgtFee 150 Bank Charges for Dec BAC

Part of the xml as below

    <ENVELOPE>
    <HEADER>
    <TALLYREQUEST>Import Data</TALLYREQUEST>
    </HEADER> 
    <BODY>
    <IMPORTDATA>
    <REQUESTDESC>
    <REPORTNAME>All Masters</REPORTNAME>
    <STATICVARIABLES>
    <SVCURRENTCOMPANY>Column 6</SVCURRENTCOMPANY>
    </STATICVARIABLES>
    </REQUESTDESC>
    <REQUESTDATA>
    <TALLYMESSAGE>
    <VOUCHER REMOTEID="" VCHKEY="" VCHTYPE="Payment"    ACTION="Create"> 
    <TALLYMESSAGE xmlns:UDF="TallyUDF">
    <NARRATION> Colum 5 </NARRATION>
    <VOUCHERTYPENAME> Payment </VOUCHERTYPENAME>
    <PARTYLEDGERNAME>" Column 2 </PARTYLEDGERNAME>
    <EFFECTIVEDATE>Column 1</EFFECTIVEDATE>
    <LEDGERNAME>Column 2</LEDGERNAME>
    <AMOUNT>Column 4</AMOUNT>
    </VOUCHER>
    </TALLYMESSAGE>
    </REQUESTDATA>
    </IMPORTDATA>
    </BODY>
    </ENVELOPE>

Here is the post method I am using for single company

    xmlhttp.Open "post", "http://localhost:9000", False
    xmlhttp.setRequestHeader "Content-Type", "application/xml"
    xmlhttp.setRequestHeader "Content-Length", "356"
    xmlhttp.setRequestHeader "Accept", "text/xml"
    xmlhttp.setRequestHeader "Host", "localhost:" & UserForm1.txtPort & """"
    xmlhttp.setRequestHeader "Cache-Control", "no-cache"

    xmlhttp.send myXMLstr
    MsgBox xmlhttp.responseText

Any idea on how to do this will be appreciated.

Thank you.

1 Answers1

0

Edited answer as per new Data

MsgBox Cells(row ,5).value
Startrow = 2
for row = 0 + Startrow to 4
.....other xml
myXMLstr += <SVCURRENTCOMPANY>Cells(row ,5).value</SVCURRENTCOMPANY>
...other xml
..other code
xmlhttp.send myXMLstr
MsgBox xmlhttp.responseText
next row
sai vineeth
  • 891
  • 2
  • 5
  • 11