<%@ Language=VBScript %> <% Response.Buffer = True Response.ContentType = "application/vnd.ms-excel" Dim objWorkbook, c, objSheet1, objSheet2, objSheet3, intCol, intRow Set objWorkbook = CreateObject("OWC10.Spreadsheet") Set c = objWorkbook.Constants Set objSheet1 = objWorkbook.Worksheets(1) objSheet1.Name = "One" Set objSheet2 = objWorkbook.Worksheets(2) objSheet2.Name = "Two" objWorkbook.Worksheets(3).Delete objSheet1.Activate Call WriteData(3, "Red") objSheet2.Activate Call WriteData(7, "Blue") objWorkbook.DisplayToolbar = False objWorkbook.AutoFit = True objSheet1.Activate Response.Write objWorkbook.XMLData Response.End Set objWorkbook = Nothing Set c = Nothing Set objSheet1 = Nothing Set objSheet2 = Nothing Set objSheet3 = Nothing Sub WriteData(pintDivisor, pstrColor) With objWorkbook.ActiveSheet For intRow = 1 To 100 For intCol = 1 To 10 .Cells(intRow, intCol).Value = (intRow - intCol) / pintDivisor If .Cells(intRow, intCol).Value Mod 3 = 0 Then .Cells(intRow, intCol).Interior.Color = pstrColor End If Next .Cells(intRow, 11).Value = "= I" & CStr(intRow) & "+J" & CStr(intRow) If intRow Mod 2 = 0 Then .Cells(intRow, 11).Interior.Color = "LightGray" Next .Columns("A:D").AutoFilter End With End Sub %>