I figured out a trick to make this work. I ran the results of my code to a text file via strtofile() and removed the response.contenttype, redirected the script to another script which reads the text file via filetostr() and was able to get response.contenttype to display properly in Excel in this other script. I think the key was the response.redirect. Just thought I'd post in case anyone else comes across this.
Sent by Jim Weesies on 12/31/2003 08:56:20 AM:
I'm trying to bring up a page in Excel with an IE browser using Response.ContentType = "application/vnd.ms-excel". I've used this dozens of times with ASP and the old Foxweb 1.x with no problems. I have a script running in Foxweb 2.x that does the following:
<%
code
.
.
Response.ContentType = "application/vnd.ms-excel"
%>
then html to define the table. The page is about to display when a download prompt appears, Excel launches, and a blank Excel page resutls. If I comment out the Response.ContentType code, an html table appears fine. I can save the output source html to a .fwx file and add just the <% Response.ContentType="application/vnd.ms-excel %> code at the top of the file and it runs and displays fine. Only when running the additional code do I get the download and blank Excel page.
Any ideas would be appreciated.