# NOT RUN {
# Windows-specific example
XLGetRange(file="C:/My Documents/data.xls",
sheet="Sheet1",
range=c("A2:B5","M6:X23","C4:D40"))
# if the current region has to be read (incl. a header), place the cursor in the interesting region
# and run:
d.set <- XLGetRange(header=TRUE)
# Get XL nameslist
nm <- xl$ActiveWorkbook()$names()
lst <- list()
for(i in 1:nm$count())
lst[[i]] <- c(name=nm[[i]]$name(),
address=nm[[i]]$refersToRange()$Address())
# the defined names
as.data.frame(do.call(rbind, lst), stringsAsFactors = FALSE)
# }
Run the code above in your browser using DataLab