Hi all,
I'm trying to generate a simple Excel spreadsheet via ASP but I'm running in to trouble. Here's the code:
<%
response.AddHeader "Content-disposition", "attachment; filename=test.xls"
response.AddHeader "Content-type:", "excel/ms-excel; name=test.xls"
%>
<table>
<tr><td>01234</td><td>abcde</td></tr>
<tr><td>01234</td><td>abcde</td></tr>
</table>
Problem 1: I'm getting an intermittent error when loading the page:
"Internet Explorer cannot download exceltest.asp from <myservername>.
Internet Explorer was not able to open this Internet Site. The requested site is either unavailable or cannot be found." I get this prob. very 1 in 3 loads and I've scoured the net without a solid answer...
Problem 2: Excel cells default to the Generic format which means that the string "01234" above gets converted to a number and drops the leading zero. ie. "01234" becomes 1234. Is there a way around this ??
Any help would be appreciated as I've spent hours on this already...
cheers,
Matt.
--
Matt Pegg
tDC - Ballarat, Australia
email: xxxx@xxxxxxxx.xxx