title: How to access XML Spreadsheet format?
body: <p>I would like to access the XML data which Excel is putting onto the clipboard.</p>
  
  <p>Visual Studio 2012, .NET 4.5, C#</p>
  
  <p>I know I could parse the XML document with XML functions, but probably there is a somewhat more simpler tool available. </p>
  
  <p>Ideally, I'm looking for a function like <code>object GetCell(row, col)</code> which delivers the content at a specific location.</p>
  
  <p>I only need to access table data.</p>
  
  <p>Parsing is not so simple, because Excel skips empty rows and columns, and puts an index into the following cell.</p>
  
  <p>Currently, we are using tabbed text format, but that has a lot of exchange problems (confused dot and comma, confused date formats, text interpreted as number, ...). The xml format is much more robust.</p>
  
  <p>Below is an example how that XML format looks alike. This a grid area with 3 columns and 6 rows. Please note the different data formats and the empty cells and rows.</p>
  
  <p>I would be mainly interested in parsing the <code>&lt;table&gt;</code>. All other is not of main interest.</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;?mso-application progid="Excel.Sheet"?&gt;
  &lt;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"&gt;
   &lt;Styles&gt;
    &lt;Style ss:ID="Default" ss:Name="Normal"&gt;
     &lt;Alignment ss:Vertical="Bottom"/&gt;
     &lt;Borders/&gt;
     &lt;Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/&gt;
     &lt;Interior/&gt;
     &lt;NumberFormat/&gt;
     &lt;Protection/&gt;
    &lt;/Style&gt;
    &lt;Style ss:ID="s62"&gt;
     &lt;NumberFormat ss:Format="Short Date"/&gt;
    &lt;/Style&gt;
   &lt;/Styles&gt;
   &lt;Worksheet ss:Name="Tabelle1"&gt;
    &lt;Table ss:ExpandedColumnCount="3" ss:ExpandedRowCount="6"
     ss:DefaultColumnWidth="60" ss:DefaultRowHeight="15"&gt;
     &lt;Column ss:AutoFitWidth="0" ss:Width="117"/&gt;
     &lt;Row&gt;
      &lt;Cell&gt;&lt;Data ss:Type="Number"&gt;1&lt;/Data&gt;&lt;/Cell&gt;
      &lt;Cell&gt;&lt;Data ss:Type="Number"&gt;2.2999999999999998&lt;/Data&gt;&lt;/Cell&gt;
      &lt;Cell ss:StyleID="s62"&gt;&lt;Data ss:Type="DateTime"&gt;2013-04-07T00:00:00.000&lt;/Data&gt;&lt;/Cell&gt;
     &lt;/Row&gt;
     &lt;Row&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;Number as Text:&lt;/Data&gt;&lt;/Cell&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String" x:Ticked="1"&gt;0123&lt;/Data&gt;&lt;/Cell&gt;
     &lt;/Row&gt;
     &lt;Row&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;next cell is empty&lt;/Data&gt;&lt;/Cell&gt;
      &lt;Cell ss:Index="3"&gt;&lt;Data ss:Type="String"&gt;b&lt;/Data&gt;&lt;/Cell&gt;
     &lt;/Row&gt;
     &lt;Row&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;next 5 cells are all empty&lt;/Data&gt;&lt;/Cell&gt;
     &lt;/Row&gt;
     &lt;Row ss:Index="6"&gt;
   &lt;Cell&gt;&lt;Data ss:Type="String"&gt;This is&lt;/Data&gt;&lt;/Cell&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;the&lt;/Data&gt;&lt;/Cell&gt;
      &lt;Cell&gt;&lt;Data ss:Type="String"&gt;last line&lt;/Data&gt;&lt;/Cell&gt;
     &lt;/Row&gt;
    &lt;/Table&gt;
   &lt;/Worksheet&gt;
  &lt;/Workbook&gt;
  </code></pre>