if (FALSE) {
## senseless actions
data(iris)
data(cars)
xl.workbook.add()
xlrc[a1] = iris
xl.workbook.save("iris.xlsx")
xl.workbook.add()
xlrc[a1] = cars
xl.workbook.save("cars.xlsx")
xl.workbook.activate("iris")
xl.workbook.close("cars")
xl.workbook.open("cars.xlsx")
xl.workbooks()
for (wb in xl.workbooks()) xl.workbook.close(wb)
unlink("iris.xlsx")
unlink("cars.xlsx")
# password-protected workbook
data(iris)
xl.workbook.add()
xlrc[a1] = iris
xl.workbook.save("iris.xlsx", password = "my_password")
xl.workbook.close()
xl.workbook.open("iris.xlsx", password = "my_password")
xl.workbook.close()
unlink("iris.xlsx")
}
Run the code above in your browser using DataLab