Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004

    Unanswered: Major Problems with OWC and ASP exporting to Excel

    Ok, I am posting a very important note: I need a lot of basic hand holding on this one

    1) I don't understand the difference between using the technique and complete ways of using Server.CreateObject("Excel.Application") vs. Server.CreateObject("OWC.Spreadsheet"). What is the difference between the two? I have also seen Server.CreateObject("Excel.Sheet"), what is that in the context of these 3?

    2) I need the history and what is used today....Excel.Application or OWC?

    3) I am having problems with my code below. It doesn't do anything. The function is indeed getting to the Call objSpreadsheet.Export

    My ultimage goals:

    1) I will be in the end allowing the end user to click on a link or button that downloads the ASP table(s) into one or more worksheets in one Excel file

    2) I will need to format the cell colors in Excel to match what my HTML table is retain the formatting.

    So here is my code which when is called, nothing happens. It is indeed getting to the line Call objSpreadsheet.Export("C:\testing.xls",0) but I am not getting prompted (as a client) to save the data into an Excel doc.

    Sub SaveToExcel

    On Error Resume Next
    dim objSpreadsheet
    Set objSpreadsheet = Server.CreateObject("OWC.Spreadsheet")

    objSpreadsheet.Cells(1,1).Value = "testing"

    if isObject(objSpreadsheet) then
    response.write("Object Exists")
    response.write("Object does not exist")
    end if

    Call objSpreadsheet.Export("C:\testing.xls",0)

    Response.Write "<br>Call done"

    End Sub

  2. #2
    Join Date
    Apr 2004
    Use the following:

    Response.Buffer = True
    Response.ContentType = "application/"
    Response.AddHeader "content-disposition", "inline; filename = ASP_Excel_Doc.xls"

    ' Output your HTML here


  3. #3
    Join Date
    Apr 2004

    doesn't quite do it

    that way is totally different than what I am using. That is like a quick dirty way and doesn't provide much other than exporting your data from a table into Excel....that is not what I am doing, I am exporting from an array to Excel and furthermore I have to be able to format the excel data, cells, etc. and also move them into one spreadsheet via multiple worksheets.

    thanks anyway. I am using OWC (Office Web Components) here which is way more advanced

Posting Permissions

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