writing to an excel file.

Results 1 to 3 of 3

Thread: writing to an excel file.

  1. #1
    Join Date
    Dec 1969

    Default writing to an excel file.

    I have produced a questionnaire in a form and would like to have the results posted to an excel file if possible, is there a tutorial on how to do this? I have never written anything to a text file before using asp, so a basic tutorial would probably be best.<BR><BR>thansk alot.

  2. #2
    M!ke Guest

    Default RE: writing to an excel file.

    The best way to do this (as I have done it several times) is to write a dll in VB (where you&#039ll find Excel objects), register it on your web server and call the dll interfaces from your ASP pages.<BR>You&#039ll find that it is extremely easy to interact with Excel using VB&#039s Excel objexts...<BR><BR>Hope this helps

  3. #3
    Join Date
    Dec 1969

    Default RE: writing to an excel file.

    starting with office97 excel can read html files so basically all you have to do is write out the data to an html table and set the content type of the asp page to msexcel. example of how to create an excel spreadsheet of all users:(best thing is to open the asp page in a new window)<BR><BR>objComm.CommandText = "select firstname,lastname from users"<BR>objComm.CommandType = 1<BR>Set objComm.ActiveConnection = objConn <BR>Set rs = objComm.Execute<BR>Response.ContentType = "application/vnd.ms-excel" <BR>response.AddHeader "content-disposition", "inline; filename=logfile.xls"<BR>now just write out the recordset in a table<BR><BR>the last file sets the filename for the document to "logfile.xls". excel will open automatically within the browser window and the user can save the file

Posting Permissions

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