```<%@ Page Language="VB" EnableViewState="false" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Excel Report to Excel with ASP.NET and VB.NET Returns XLS Workbook Using SpreadsheetGear</title>
<meta content="Excel Report to Excel with ASP.NET, Visual Basic .NET and SpreadsheetGear, a royalty free Microsoft Excel compatible spreadsheet component for the Microsoft .NET Framework featuring the fastest and most complete calculation engine available. Create, read, modify, calculate and write Microsoft Excel workbooks from your Microsoft .NET, ASP.NET, C#, VB.NET and Microsoft Office solutions. Integrates with Microsoft Visual Studio .NET, including IntelliSense and Dynamic Help." name="description" />
<script language="VB" runat="server">

Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
' Create a new workbook.
Dim worksheet As SpreadsheetGear.IWorksheet = workbook.Worksheets("Sheet1")
Dim cells As SpreadsheetGear.IRange = worksheet.Cells

' Set the worksheet name.
worksheet.Name = "2005 Sales"

' Load column titles and center.
cells("B1").Formula = "North"
cells("C1").Formula = "South"
cells("D1").Formula = "East"
cells("E1").Formula = "West"

' Load row titles using multiple cell text reference and iteration.
Dim quarter As Integer = 1
For Each cell In cells("A2:A5")
cell.Formula = "Q" & quarter
quarter = quarter + 1
Next cell

' Load random data and format as \$ using a multiple cell range.
Dim body As SpreadsheetGear.IRange = cells(1, 1, 4, 4)
body.Formula = "=RAND() * 10000"
body.NumberFormat = "\$#,##0_);(\$#,##0)"

' Stream the Excel workbook to the client in the Excel 97-2003 (xls)
' file format compatible with Excel 97-2019 and Excel for Office 365.
Response.Clear()
Response.ContentType = "application/vnd.ms-excel"