none
export xml data spreadsheet 2007 RRS feed

  • Question

  • Hi,

    I´ve an Excel document attached with a CustomXML (XSD).
    I need to export the data in c# in XML.  (Do the same work Office 2007 when you click on the Export button Developer Toolbar in the ribbon.

    There is lot of exemple how to add custom XML to Excel but i´ve never found something talking about retrieve the data of the Excel document.

    Thanks a lot if you´ve got an idea to do this.


    Anto.
    Thursday, November 20, 2008 5:26 PM

All replies

  • Take a look at the following blog post: http://blogs.msdn.com/brian_jones/archive/2008/11/10/reading-data-from-spreadsheetml.aspx

    Let me know if you have more questions.

    Zeyad Rajabi (MS)
    Zeyad Rajabi (MS)
    Thursday, November 20, 2008 7:02 PM
  • Hi Zeyab,

    Thanks for you Response,

    reading your link i try to find the definedName tag in workBook.xml but there is no all the relation between my SpreedSheet and my XSD.

    So I browse the docx and if Found where they are defined. In the folder Xl -> tables -> tableSingleCells2.xml


    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>   
    <singleXmlCells xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">  
    <singleXmlCell id="7" r="C13" connectionId="0">  
    <xmlCellPr id="1" uniqueName="1">  
      <xmlPr mapId="5" xpath="/Document/INFEVALCONT046/MemPresupTotalGasto" xmlDataType="float" />   
      </xmlCellPr> 
      </singleXmlCell> 
    <singleXmlCell id="8" r="H6" connectionId="0">  
    <xmlCellPr id="1" uniqueName="1">  
      <xmlPr mapId="5" xpath="/Document/INFEVALCONT046/MemPresupInvActMat" xmlDataType="float" />   
      </xmlCellPr> 
      </singleXmlCell> 
    <singleXmlCell id="9" r="H8" connectionId="0">  
    <xmlCellPr id="1" uniqueName="1">  
      <xmlPr mapId="5" xpath="/Document/INFEVALCONT046/MemPresupTotalInvers" xmlDataType="float" />   
      </xmlCellPr> 
      </singleXmlCell> 
    <singleXmlCell id="16" r="D20" connectionId="0">  
    <xmlCellPr id="1" uniqueName="1">  
      <xmlPr mapId="5" xpath="/Document/INFEVALCONT046/GastAuditITPersonal" xmlDataType="float" />   
      </xmlCellPr> 
      </singleXmlCell> 
    <singleXmlCell id="17" r="D21" connectionId="0">  
    <xmlCellPr id="1" uniqueName="1">  
      <xmlPr mapId="5" xpath="/Document/INFEVALCONT046/GastAuditITGastosAct" xmlDataType="float" />   
      </xmlCellPr> 
      </singleXmlCell> 
    <singleXmlCell id="18" r="D22" connectionId="0">  
    <xmlCellPr id="1" uniqueName="1">  
      <xmlPr mapId="5" xpath="/Document/INFEVALCONT046/GastAuditITMatConsum" xmlDataType="float" />   
      </xmlCellPr> 
      </singleXmlCell> 
    <singleXmlCell id="19" r="D23" connectionId="0">  
    <xmlCellPr id="1" uniqueName="1">  
      <xmlPr mapId="5" xpath="/Document/INFEVALCONT046/GastAuditITOtrosGastos" xmlDataType="float" />   
      </xmlCellPr> 
      </singleXmlCell> 
    <singleXmlCell id="20" r="D24" connectionId="0">  
    <xmlCellPr id="1" uniqueName="1">  
      <xmlPr mapId="5" xpath="/Document/INFEVALCONT046/GastAuditITColabExt" xmlDataType="float" />   
      </xmlCellPr> 
      </singleXmlCell> 
    <singleXmlCell id="21" r="D25" connectionId="0">  
    <xmlCellPr id="1" uniqueName="1">  
      <xmlPr mapId="5" xpath="/Document/INFEVALCONT046/GastAuditITOtrasColabExt" xmlDataType="float" />   
      </xmlCellPr> 
      </singleXmlCell> 
    <singleXmlCell id="22" r="D26" connectionId="0">  
    <xmlCellPr id="1" uniqueName="1">  
      <xmlPr mapId="5" xpath="/Document/INFEVALCONT046/GastAuditITTotal" xmlDataType="float" />   
      </xmlCellPr> 
      </singleXmlCell> 
    <singleXmlCell id="24" r="C27" connectionId="0">  
    <xmlCellPr id="1" uniqueName="1">  
      <xmlPr mapId="5" xpath="/Document/INFEVALCONT046/GastAuditTotal" xmlDataType="float" />   
      </xmlCellPr> 
      </singleXmlCell> 
    <singleXmlCell id="25" r="D33" connectionId="0">  
    <xmlCellPr id="1" uniqueName="1">  
      <xmlPr mapId="5" xpath="/Document/INFEVALCONT046/InvAuditITActMat" xmlDataType="float" />   
      </xmlCellPr> 
      </singleXmlCell> 
     

    r is the cell were my data is located. And the Xpath to my Xsd.

    So it´s little bit different. if you´ve got a sample to create my Xml file using tablesinglecell.xsml it would be perfect.

    In Other Way I´m going to find a way to create the Xml data i need.

    At the beginning this document was an office 2003 embeded with an Xsd File. I use office 2007 and save it as 2007 document.
    I do that because in need my website to retrieve the data user send me and it could change my base file 2003 to 2007. So it´s interesting for me to understand the structure and the way to support both format.

    So if you´ve got  more information about compatibility problem in both version i will happy to read it.

    Anto




    Friday, November 21, 2008 8:17 AM