Forum Moderators: open
Include:
Response.ContentType = "application/vnd.ms-excel"
as the first line of code. Instead of sending back an HTML document, asp will send it back as a spreadsheet. Your <table>,<tr> and <td> will be used to get things to the right cells.
Including things like =SUM(A1:A10) will be interpeted as a formula.
The client pc must have Excel installed on it to use this output. When the spreadsheet is downloaded the file may be displayed in the IE 5.5 and NS 4.7 browser or saved to a file.
Does anyone have any experience is loading VBA to the downloaded spreadsheet?
print "Content-Type: application/vnd.ms-excel\n\n"; - instead of text/html.
using \t as delimiters for the columns - not html - though I'll try that later, find out whether its asp or excel handling the conversion.
Thanks for the tip on formulas. As for VBA erm ... nope not done that yet (hoping I don't have to ;))
On Windows, Macs and even Linux, where .CSV is associated with a spreadsheet software the it will be properly interpreted as a spreadsheet.
caveat emptor - CSV will only allow data not functions or formating.