SHARE
Facebook X Pinterest WhatsApp

ASP and Excel

Jul 20, 2010
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



by Armand Datema

Here is a new tutorial on how to write to an Excelsheet using ASP. The result is nothing serious, but
it shows the potential 🙂

Here 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

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.

Excelface

This completes yer ASP page,
look below for the complete code of
excelface.asp



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

%>

Excelface

Download Code

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
What Is a Network Policy Server (NPS)? | Essential Guide
Virtual Servers vs. Physical Servers: Comparison and Use Cases
Ray Fernandez
Nov 14, 2023
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.