excel.getCells
Description
Get a range of cells to a 2D array.

Parameters
bookID number
worksheetIndex number
startX number
startY number
countX number
countY number

Return value
cells 2D array (in format cells[yRow][xCol])

Example
local xl = excel.load("c:\\test.xls")
if xl < 1 then
    print("Error loading workbook")
else
    -- get first 10 rows from first column in first worksheet
    local cells = data.createGrid()
    local cells = getCells(0, 1, 1, 1, 10)

    -- display the cells
    data.ui.showGridViewerDialog("Data", cells)

    -- close the workbook
    excel.close(xl)
end if

Comments
startX and startY cell coordinates are 1 based.

See also
setCells
getCell
setCell

Back
Generated on the 26 June 2024 at 22:01:28 (UK Time)