SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post asp HTML form to Excel worksheet

    I have a form with 3 fields.
    I need some asp code to post that HTML form data to an excel worksheet thats in the same folder as the web form.
    Excel location; strCon=strCon & server.MapPath("ExcelDb.xls")

    If I can use AJAX to post those form fields to Excel as hidden fields, that'll work for me also.

    Thanks

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,037
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    You can fairly easily create an excel spreadsheet for display or download using tabular data in ASP Classic however in order to work with real MS Excel spreadsheets appending, etc., you'll have to go with a ASP.NET solution.

    I did something similar with an ASP site a few years ago and used a 3rd party component (CarlosAg.ExcelXmlWriter) to do the heavy lifting. The regular ASP site ran as usual but I added the Excel section using ASP.NET.
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  3. #3
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can do this with classic ASP also.

    http://support.microsoft.com/kb/278973

    or

    http://www.codeave.com/asp/code.asp?u_log=148

    or google

    write to excel asp -.net

  4. #4
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks.
    The part that I was looking for in Classic asp was

    Code:
     
          If Request("cmdSubmit")="Enter Data in Excel" Then
            strSQL = "INSERT INTO [Sheet1$] (Phone,Email)"
            strSQL = strSQL & " VALUES ('" & name & "'"	    etc...   )"


Bookmarks

Posting Permissions

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