ASP and Excel
by Armand DatemaHere is a new tutorial on how to write to an Excelsheet using ASP. The result is nothing serious, but it shows the potential :)
First we set the type of script
<%@ LANGUAGE="VBSCRIPT" %>
Make the object, and set the object to an Excelsheet
Dim ExcelFace
Set
ExcelFace = CreateObject("Excel.Sheet")
Now lets write the rest of the script, see the comments
' show or dont show Excel
to user, TRUE or FALSE
ExcelFace.Application.Visible =
True
' Create the yellow
face
ExcelFace.ActiveSheet.Range("F3:K25").Interior.ColorIndex
= 6
' Create both the blue
eyes
ExcelFace.ActiveSheet.Range("G6:G10").Interior.ColorIndex
=
5
ExcelFace.ActiveSheet.Range("J6:J10").Interior.ColorIndex
= 5
' Create a purple
nose
ExcelFace.ActiveSheet.Range("H13:I18").Interior.ColorIndex
= 29
' create a red
mouth
ExcelFace.ActiveSheet.Range("G21:J24").Interior.ColorIndex
= 3
' Write the
text
ExcelFace.ActiveSheet.Cells(1,1).Value = "Now isnt
this fun :) "
' Save the the excelsheet to
excelface
ExcelFace.SaveAs "c:\excelface.xls"
' Close
Excel with the Quit method on the Application
object.
ExcelFace.Application.Quit
' Release the object
variable.
Set ExcelFace = Nothing
%>
Now lets complete the HTML tags.
<HTML>
<HEAD>
<TITLE>Excelface</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
This completes yer ASP page, look below for the complete code of excelface.asp
<%@ LANGUAGE="VBSCRIPT" %>
<%
'
Create Object
Dim ExcelFace
Set ExcelFace =
CreateObject("Excel.Sheet")
' show or dont show excelto
user, TRUE or FALSE
ExcelFace.Application.Visible =
True
' Create the yellow
face
ExcelFace.ActiveSheet.Range("F3:K25").Interior.ColorIndex
= 6
' Create both the blue
eyes
ExcelFace.ActiveSheet.Range("G6:G10").Interior.ColorIndex
=
5
ExcelFace.ActiveSheet.Range("J6:J10").Interior.ColorIndex
= 5
' Create a purple
nose
ExcelFace.ActiveSheet.Range("H13:I18").Interior.ColorIndex
= 29
' create a red
mouth
ExcelFace.ActiveSheet.Range("G21:J24").Interior.ColorIndex
= 3
' Write the
text
ExcelFace.ActiveSheet.Cells(1,1).Value = "Now isnt
this fun :) "
' Save the the excelsheet to
excelface
ExcelFace.SaveAs "c:\excelface.xls"
' Close
Excel with the Quit method on the Application
object.
ExcelFace.Application.Quit
' Release the object
variable.
Set ExcelFace = Nothing
%>
<HTML>
<HEAD>
<TITLE>Excelface</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
- 1 Linux Server Management Nightmare: Attack of the Killer Penguins
- 2 Top 10 Open-Source Server Technologies You Need to Know
- 3 10 Coolest Features in Windows Server 2008
- 4 Getting Started With EFT Server -- A More Secure FTP Server Option
- 5 Making Linux Server Directories More Readable, Add to Perl's @INC Array


Windows Server 2008 R2 provides enhanced management control over resources across the enterprise. Downlaod this PDF to learn more.