Link to home
Start Free TrialLog in
Avatar of Fordraiders
FordraidersFlag for United States of America

asked on

Excel office 365 exporting data to a specific xml format

Excel office 365 exporting data to a specific xml format

I have a workbook  xml_template.xlsm  - macro book
Sheet1

however, i could have as many as 200  rows, the export will always vary.
But  will always include  Columns  A B C

On sheet 1 i have data as such:
User generated image





I need to export it out to a text.xml  file in the format below:
User generated image
It has to be in this format for a payload to a webservice

I tried just doing a save as and XML file in Excel but will not work properly


Thanks
fordraiders
Avatar of Tom Farrar
Tom Farrar
Flag of United States of America image

So as I understand XML file merge, you need two files:  the data file saved as .xml and the schema file saved as .xsd file.  It looks like you have the two files.  What were your next steps?
Avatar of Fordraiders

ASKER

i need to click on a button on the sheet to export the data from sheet1 to an xml file like this
xml format needed.jpg

Open in new window


 
ASKER CERTIFIED SOLUTION
Avatar of Tom Farrar
Tom Farrar
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok..Posting like this
User generated image schema file is as:
User generated image

Data xml file is as:
User generated image


chnages the schema to this and worked.


<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Technologies Online Tools 1.0 (https://www.liquid-technologies.com) -->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="EsrpPriceRequest">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Quote_Number" type="xs:string" />
        <xs:element name="Account_Number" type="xs:string" />
        <xs:element name="Items">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" name="Items" type="xs:string" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
I think I over-complicated the question. If you need Sheet 1 to look like the

User generated image
Then it most likely is as simple as what is shown in this short video.. Import the above saved notepad into XML source, then follow steps through exporting to XML file.  This should work. 
https://www.youtube.com/watch?v=uDESRpPlOtk 


Hey, great.  Glad you got there.  Sorry I couldn't help more.
thanks