Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    11

    Unanswered: Error exporting to Excel

    Trying to export data to Excel. It's probably been four years since I've used straight ASP (vs. .NET) so I'm a bit rusty. Found several articles and forum posts with people having this same error, but no resolution on any of them.

    Clicking the link to my ASP file pops up a download box, then immediately an error box that says the site cannot be found. If I remove the Excel headers, the page displays perfectly--an unformatted table of my data.

    Any suggestions would be great.

    Thanks

    Code:
    <%
    Response.ContentType = "application/vnd.ms-excel"
    Response.AddHeader "Content-Disposition", "attachment; filename=userlist.xls"
    %>
    <table>
    <%
    Dim Database, i
    Set Database = ConnectDB()
    Dim rsUserEmails, UserEmails
    UserEmails = Empty
    Set rsUserEmails = Database.Execute("SELECT * FROM Users")
    Do Until rsUserEmails.EOF
    %>
    	<tr>
                          ... data here ...
    	</tr>
    	<%
    	rsUserEmails.MoveNext
    Loop
    rsUserEmails.Close
    Set rsUserEmails = Nothing
    %>
    </table>
    <%
    Database.Close
    Response.End
    %>

  2. #2
    Join Date
    Apr 2004
    Posts
    11

    Nevermind..

    Knocked out my database include file when clearing out some of the header.

    Thanks for taking a look.

    Works like a champ now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •