W
wasteheap
Take the following VB.NET code.
-------------------------------
Dim ss as New OWC10.Spreadsheet
For i As Integer = 1 To 10
ss.ActiveSheet.Cells.Item(i).Value = "x"
Next
-------------------------------
The resulting spreadsheet has x's across the first 10 cells of the
first row.
According to the MS documentation:
-------------------------------
Item property as it applies to the Range object.
Returns a Range object that represents a specific cell within the
specified range of cells.
expression.Item(RowIndex, ColumnIndex)
expression Required. An expression that returns a Range object.
RowIndex Required Variant. The row index of the cell that you want
to return.
ColumnIndex Optional Variant. The column index of the cell that you
want to return.
-------------------------------
Also in Visual Studio, I see
Item(RowIndex As Object, [ColumnIndex As Object])
pop up as I type.
This tells me that
.item(2)
should be equivalent to
.range(.item(2, 1), .item(2, maxCol)) 'Entire 2nd row
or at least
.item(2, 1) 'First cell in 2nd row
HOWEVER it is apparently implemented as
.item(1, 2) '2nd cell of *1st* row
but rowIndex = 2 !!!!
What gives???
-------------------------------
Dim ss as New OWC10.Spreadsheet
For i As Integer = 1 To 10
ss.ActiveSheet.Cells.Item(i).Value = "x"
Next
-------------------------------
The resulting spreadsheet has x's across the first 10 cells of the
first row.
According to the MS documentation:
-------------------------------
Item property as it applies to the Range object.
Returns a Range object that represents a specific cell within the
specified range of cells.
expression.Item(RowIndex, ColumnIndex)
expression Required. An expression that returns a Range object.
RowIndex Required Variant. The row index of the cell that you want
to return.
ColumnIndex Optional Variant. The column index of the cell that you
want to return.
-------------------------------
Also in Visual Studio, I see
Item(RowIndex As Object, [ColumnIndex As Object])
pop up as I type.
This tells me that
.item(2)
should be equivalent to
.range(.item(2, 1), .item(2, maxCol)) 'Entire 2nd row
or at least
.item(2, 1) 'First cell in 2nd row
HOWEVER it is apparently implemented as
.item(1, 2) '2nd cell of *1st* row
but rowIndex = 2 !!!!
What gives???