View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chris Oswald Chris Oswald is offline
external usenet poster
 
Posts: 1
Default ASP Dynamic Excel Creation

When I dynamically generate my Excel file it prompts me
twice to open it. Any ideas why?

Office 2003
Windows XP
IE 6

Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-
Disposition", "attachment;filename=OSRHistory" &
strVersion & ".xls"

%
<table border="1"
<tr
<%
For Each objField In objRS.Fields
%
<th style="background-
color:gray;color:white"<%=objField.Name%</th
<%
Next
%

</tr

<%
While Not objRS.EOF
%
<tr
<%
For Each objField In
objRS.Fields

If (UCASE(objField.Name) = "STATION") Then

%
<td align="Center"<%="&nbsp;" & CStr
(objField.Value)%</td
<%
Else
%
<td<%=objField.Value%</td
<%
End If
Next
%
</tr
<%
objRS.MoveNext

WEnd
%
</table
<%