ServerWatch™ - Serving Trends and Analysis to the Enterprise
ServerWatch™ - Serving Trends and Analysis to the Enterprise
Search ServerWatch
Search ServerWatch
Search ServerWatch



Become a Marketplace Partner

  • Partner With Us














ServerWatch > Tutorials

June 10, 1999
ASP and Excel

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 :)

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>

Download Code

Go to page 1  2  


Discuss this article
Tools:
Add serverwatch.com to your favorites
Add serverwatch.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x

Tutorials Archives


internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES