Listing D
Dim Xcl
Sub StartExcel()
    Set Xcl = CreateObject("Excel.Application")
    Xcl.Visible = true
    Set newBook = Xcl.Workbooks.Add
    newBook.Worksheets(1).Activate
    newBook.Worksheets(1).Range("A1:B1000").NumberFormat = "0"
    newBook.Worksheets(1).Cells(1,1).value="Value1"
    newBook.Worksheets(1).Cells(2,1).value="Value2"
    newBook.Worksheets(1).Cells(1,2).value="20"
    newBook.Worksheets(1).Cells(2,2).value="10"
    newBook.Worksheets(1).Cells(3,1).value="Total"
    newBook.Worksheets(1).Cells(3,2).value="=Sum(B1:B2)"
    newBook.Worksheets(1).Cells(4,1).value="Total Times 2"
    newBook.Worksheets(1).Cells(4,2).value=CInt(newBook.Worksheets(1).Cells(3,2).value * 2)
    newBook.Worksheets(1).Name="My First WorkSheet"
end Sub