# NOT RUN {
file <- system.file("tests", "test_import.xlsx", package = "xlsx")
wb <- loadWorkbook(file)
sheet <- getSheets(wb)[["deletedFields"]]
ranges <- getRanges(wb)
ranges[[1]]$getNameName() # get its name
# see all the available java methods that you can call
.jmethods(ranges[[1]])
# create a new named range
firstCell <- sheet$getRow(14L)$getCell(4L)
lastCell <- sheet$getRow(20L)$getCell(7L)
rangeName <- "Test2"
createRange(rangeName, firstCell, lastCell)
# }
Run the code above in your browser using DataLab