If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Major Problems with OWC and ASP exporting to Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-27-04, 17:24
dba321 dba321 is offline
Registered User
 
Join Date: Apr 2004
Posts: 8
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 showing...so 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")
else
response.write("Object does not exist")
end if

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

Response.Write "<br>Call done"

End Sub
Reply With Quote
  #2 (permalink)  
Old 04-28-04, 10:05
ASP-Hosting.ca ASP-Hosting.ca is offline
Registered User
 
Join Date: Apr 2004
Posts: 50
Use the following:

<%
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition", "inline; filename = ASP_Excel_Doc.xls"

' Output your HTML here

%>
Reply With Quote
  #3 (permalink)  
Old 04-30-04, 17:53
dba321 dba321 is offline
Registered User
 
Join Date: Apr 2004
Posts: 8
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On