Along with the Content-Type: header declaration that Thomas Reynolds suggests, one straightforward method of writing spreadsheet data (that is also cross-platform) is to output it as a CSV file - that'd just be plain text with a .csv extension (use Excel to save one off and open it in a text editor to see what I mean - that'd be faster than explaining it here).
To specify the extension (so's it doesn't get saved as something.php and requiring naming it back to something.csv by hand) the header is
Content-Disposition: [disposition]; filename=$filename.csv
Where [disposition] is either:
inline (for displaying in the browser (at least, that's what IE/Excel would do)), or
attachment (for download/saving).