If you are still keen on writing an excel file, try the following
1) Open you spreadsheet
2) Save it as a
XML Spreadsheet 2003(*.xml). Let us call this top.xml. Note that there is an xml format further up: don't use that one. Use the one that says XML Spreadsheet.
3) Copy top.xml to bottom.xml
4) Open top.xml in notepad. Look for ss:Name=”Sheet1”. Look further down for the first <row>. Delete from that point to the end of the file. Save and close
5) Open bottom.xml in notepad. Look for ss:Name=”Sheet1”. Look for </Table>. Delete from the line before to the beginning of the file. Save and close
6) Write a program to do the following
a. Open a new spreadsheet, say madeup.xml
b. Copy the entire contents of top.xml to madeup.xml
c. Write out your data in the following format
i. For each row, print <Row ss:AutoFitHeight=”0”>
ii. For each column print <Cell><Data ss:Type=”Number”>x</Data></Cell> where x is the number
iii. To end the row, print </Row>
d. Copy the entire contents of bottom.xml to madeup.xml
e. Close madeup.xml
7) Open madeup.xml in excel and it should execute all your formulas.