
Last chance! 50% off unlimited learning
Sale ends in
xl.workbook.add(filename = NULL)
xl.workbook.open(filename, password = NULL)
xl.workbook.activate(xl.workbook.name)
xl.workbooks()
xl.workbook.save(filename, password = NULL)
xl.workbook.close(xl.workbook.name = NULL)
xl.workbook.add
/xl.workbook.open
/xl.workbook.activate
invisibly return name of created/open/activated workbook.
xl.workbooks
returns character vector of open workbooks.
xl.workbook.save
invisibly returns path to the saved workbook
xl.workbook.close
invisibly returns NULL. xl.workbook.add
adds new workbook and
invisibly returns name of this newly created workbook. Added workbook become
active. If filename
argument is provided then Excel workbook
filename
will be used as template.
xl.workbook.activate
activates workbook with given name. If
workbook with this name doesn't exist error will be generated.
xl.workbook.save
saves active workbook. If only
filename
submitted it saves in the working directory. If name of
workbook is omitted than new workbook is saved under its default name in the
current working directory. It doesn't prompt about overwriting if file
already exists. xl.workbook.close
closes workbook with given
name. If name isn't submitted it closed active workbook. It doesn't prompt
about saving so if you don't save changes before closing all changes will be
lost. xl.sheets
, xl.read.file
,
xl.save.file
## Not run:
# ## 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")
# ## End(Not run)
Run the code above in your browser using DataLab