I have a string of XML that I want to load directly into a spreadsheet with C#. I've found a few examples but haven't quite been able to fill in the gaps in my knowledge.
Range r = Globals.ThisAddIn.Application.Worksheets["Sheet1"].Range["A1", Missing.Value];
Workbook w = Globals.ThisAddIn.Application.ActiveWorkbook;
w.XmlImportXml(xmlString, out map1, true, r);
It seems that the "map1" variable would be the mapping of the XML schema. How do I do this? Do I have to specify an .xsd file or can this be created programmatically? What is the preferred way to handle this?
My XML layout is similar to:
<root>
<parent>
<childOne>5</childOne>
<childTwo>8</childTwo>
</parent>
<parent>
<childOne>10</childOne>
<childTwo>15</childTwo>
</parent>
</root>