
Querying the last (non-empty) row on a worksheet
getLastRow-methods.RdQueries the last (non-empty) row on a worksheet.
Usage
# S4 method for class 'workbook,character'
getLastRow(object,sheet)
# S4 method for class 'workbook,numeric'
getLastRow(object,sheet)Arguments
- object
The
workbookto use- sheet
The name or index of the sheet of which to query the last row
Author
Martin Studer
Mirai Solutions GmbH https://mirai-solutions.ch
Examples
if (FALSE) { # \dontrun{
# mtcars xlsx file from demoFiles subfolder of package XLConnect
demoExcelFile <- system.file("demoFiles/mtcars.xlsx", package = "XLConnect")
# Load workbook
wb <- loadWorkbook(demoExcelFile)
# Query the last row of the 'mtcars' worksheet
getLastRow(wb, "mtcars")
# Query the last row of the 'mtcars2' worksheet
getLastRow(wb, "mtcars2")
# Query the last row of the 'mtcars3' worksheet
getLastRow(wb, "mtcars3")
} # }