Sunday, August 26, 2007

OOXML is defective by design

I haven't tried this yet:

The entire article can be found here

Self exploding spreadsheets.

To reproduce the scenario :

  • start Excel 2007 and create a new spreadsheet
  • insert a value 10 in a cell
  • insert a value 20 next to it
  • select the two cells and click on the "sum" button to create a sum of the two cells
  • save the spreadsheet (xlsx file)
  • close it and unzip it

The corresponding XML in the main part is :



10


20


SUM(C2:D2)
30

Pretty simple XML. Now say we want to edit cell E2 and set a constant value of 40 in place of a formula. But instead of doing that with Excel 2007 interactively, we are going to do it manually :

  • unzip the file
  • grab a zip part known as xl/worksheets/sheet1.xml
  • make the edit described below
  • put the updated zip part back in the zip package
  • zip it

The corresponding valid (and carefully changed) XML for setting the constant value of 40 in cell E2 is :



10


20


40

Now open the file in Excel 2007.

The entire article can be found here

No comments: