There are libraries out there that can help you. Not all have the same functionality covered, and not all have the same licensing.
- This one could be used for the old (xls) format:
http://code.google.com/p/excellibrary/[
^]
- Here you can read an article about how to write an xlsx on your own:
How to Read and Write .xlsx (Excel 2007) file - Part I[
^]
- You can trick Excel easily by creating a proper html file and saving it with xls extension. Will work like a charm :).
- Excel has ODS support:
How to Read and Write ODF/ODS Files (OpenDocument Spreadsheets)[
^]
- And there are other component out there you might find interesting, like this one:
http://npoi.codeplex.com/[
^]