Excel and ASP

Results 1 to 2 of 2

Thread: Excel and ASP

  1. #1
    Joe Force Guest

    Default Excel and ASP

    We have an application that requires us to build large tables for reporting purposes. HTML is way to slow and cumbersome, and doesn&#039t print very well. We have tried outputting to a tab delimitted file, but CSV files do not carry the proper formatting we need (eg. date/currency format). <BR><BR>Is there a way to write to an excel file and pre-populate headings, formulas, etc? <BR><BR>Any help would be appreciated.<BR><BR>Joe

  2. #2
    Ian Stallings Guest

    Default RE: Excel and ASP

    yes this is possible. We currently use this<BR>to write stock reports to excel spreadsheets<BR>that the users can download after they are created<BR><BR>There are alot of variables to set so I will just<BR>start you off. You can create the Excel<BR>object with the following code:<BR><BR>* just for the record, this is not my code<BR>* it was written by ARMAND DATEMA<BR><BR>&#060;%@ LANGUAGE="VBSCRIPT" &#037;&#062;<BR>&#060;%<BR>&#039 Create Object <BR>Dim ExcelFace<BR>Set ExcelFace = CreateObject("Excel.Sheet")<BR>&#039 show or dont show excelto user, TRUE or FALSE<BR>ExcelFace.Application.Visible = True<BR>&#039 Create the yellow face<BR>ExcelFace.ActiveSheet.Range("F3:K25").Inte rior.ColorIndex = 6<BR>&#039 Create both the blue eyes<BR>ExcelFace.ActiveSheet.Range("G6:G10").Inte rior.ColorIndex = 5<BR>ExcelFace.ActiveSheet.Range("J6:J10").Interio r.ColorIndex = 5<BR>&#039 Create a purple nose<BR>ExcelFace.ActiveSheet.Range("H13:I18").Int erior.ColorIndex = 29<BR>&#039 create a red mouth<BR>ExcelFace.ActiveSheet.Range("G21:J24").In terior.ColorIndex = 3<BR>&#039 Write the text<BR>ExcelFace.ActiveSheet.Cells(1,1).Value = "Now isnt this fun :) "<BR>&#039 Save the the excelsheet to excelface<BR>ExcelFace.SaveAs "c:excelface.xls"<BR>&#039 Close Excel with the Quit method on the Application object.<BR>ExcelFace.Application.Quit<BR>&#039 Release the object variable.<BR>Set ExcelFace = Nothing <BR>&#037;&#062;<BR>&#060;HTML><BR>&#060;HEAD><BR> &#060;TITLE>Excelface&#060;/TITLE><BR>&#060;/HEAD><BR>&#060;BODY><BR>&#060;/BODY><BR>&#060;/HTML><BR><BR><BR><BR>I hope this helps.

Posting Permissions

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