你好,
FpSpread1.Sheets(0).Rows.Count 为 Sheet 行的数量, 出错的原因在于 Cells 的行索引 iRow 大于最后一行索引,行索引从 0 开始,也就最后一行的行索引为 iRow -1 ,所以代码为:
- Dim iRow As Integer = FpSpread1.Sheets(0).Rows.Count
- Dim cb As New FarPoint.Web.Spread.CheckBoxCellType()
- FpSpread1.ActiveSheetView.Cells(iRow-1, 0).CellType = cb
- FpSpread1.ActiveSheetView.Cells(iRow-1, 2).CellType = sm
复制代码 |