2009-12-13 4 views
7

si j'exporte le xml ci-dessous pour exceller 2007 ... je suis en mesure d'obtenir la feuille Excel correctement.convertir xml pour exceller avec plusieurs feuille de calcul

<Workbook> 
<Worksheet > 
<MyXml> 
    <New A="111" B="222" /> 
</MyXml> 
<MyXml> 
    <New A="111" B="222" /> 
</MyXml> 
</Worksheet> 
</Workbook> 

Mais je besoin d'un classeur avec plus d'une feuille de calcul ... Comment puis-je spécifier le xml dans ce cas?

Répondre

15

Essayez ceci:

<?xml version="1.0"?> 
<?mso-application progid="Excel.Sheet"?> 
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" 
xmlns:o="urn:schemas-microsoft-com:office:office" 
xmlns:x="urn:schemas-microsoft-com:office:excel" 
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" 
xmlns:html="http://www.w3.org/TR/REC-html40"> 
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> 
    <ActiveSheet>2</ActiveSheet> 
</ExcelWorkbook> 
<Styles> 
    <Style ss:ID="Default" ss:Name="Normal"> 
    <Alignment ss:Vertical="Bottom"/> 
    <Borders/> 
    <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/> 
    <Interior/> 
    <NumberFormat/> 
    <Protection/> 
    </Style> 
</Styles> 
<Worksheet ss:Name="Sheet1"> 
    <Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="1" x:FullColumns="1" 
    x:FullRows="1" ss:DefaultRowHeight="15"> 
    <Row> 
    <Cell><Data ss:Type="Number">11</Data></Cell> 
    <Cell><Data ss:Type="Number">22</Data></Cell> 
    </Row> 
    </Table> 
</Worksheet> 
<Worksheet ss:Name="Sheet2"> 
    <Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="1" x:FullColumns="1" 
    x:FullRows="1" ss:DefaultRowHeight="15"> 
    <Row> 
    <Cell><Data ss:Type="Number">11</Data></Cell> 
    <Cell><Data ss:Type="Number">22</Data></Cell> 
    </Row> 
    </Table> 
</Worksheet> 
</Workbook> 

Pour plus d'aide, vous pouvez jeter un oeil à this.

Enfin, vous pouvez créer manuellement un classeur Excel et l'exporter au format XML afin de pouvoir examiner le format XML.

+0

Thanksssssssssssssssssssssssssssssssssssss Alottttttttttttttttttttttttttttttttttttttttttttttt ... Ce fut la réponse que je suis en attente de ..... Merci beaucoup .... Que Dieu vous bénisse –

+0

@Dana: Fantastique, mais je suppose que vous devez ajouter '' à la fin de votre échantillon pour le faire fonctionner. Sinon, le XML n'est pas valide. Cette approche semble fonctionner avec Excel 2010 et LibreOffice Calc. – Gruber

+0

@Gruber: fixe! – Dana

Questions connexes