Code: Select all
Dim Spread As OWC11.Spreadsheet
Dim stYears(0 To 2) As String
Dim iCounter As Integer
stYears(0) = "1996"
stYears(1) = "1997"
stYears(2) = "1998"
Set Spread = Me.Spreadsheet1
With Spread
.Height = 3540
.Width = 4695
With .ActiveWindow
'Set the caption of the actual columnheadings.
.ColumnHeadings(1).Caption = "Country "
.ColumnHeadings(2).Caption = "Freight "
.ColumnHeadings(3).Caption = "Shipments "
'Set the caption of the actual rowheadings.
For iCounter = 0 To 2
.RowHeadings(iCounter + 1).Caption = stYears(iCounter)
.RowHeadings(iCounter + 4).Caption = stYears(iCounter)
Next iCounter
'Limit the viewable part of the worksheet.
.ViewableRange = "A1 : D6"
End With
End With
Set Spread = Nothing