Classic ASP to Excel
Have you ever wondered how to go from a Classic ASP page to Excel? I have done this a lot usually someone in the office will ask, “Can I have the total profit of the month in a spreadsheet?” now you can handle this one of two ways go and copy all the data from the database one by one or you can extract the data and spit it out using ASP to Excel.
<%
‘The line below lets the browser know this is an Excel File
Response.ContentType = “application/vnd.ms-excel”
%>
<table>
<thead>
<tr>
<th style=”background-color:#CCCCCC;color:#FFFFFF;”>First Name</font></th>
<th style=”background-color:#CCCCCC;color:#FFFFFF;”>Last Name</font></th>
</tr>
</thead>
<tbody>
<tr>
<td>John</td>
<td>Doe</td>
</tr>
<tr>
<td>Steve</td>
<td>Smith</td>
</tr>
<tr>
<td>Frank</td>
<td>McCoy</td>
</tr>
</tbody>
</table>
Basically take the code above and paste it into your editor and save it as an ASP file run it and see the results.













