
Removing names from workbooks
removeName-methods.RdRemoves a named range reference from a workbook.
Arguments
- object
The
workbookto use- name
The name to delete
- worksheetScope
Optional - the name of the worksheet in which the name is scoped; useful if different sheets have locally-scoped named ranges with the same name.
Details
Removes the named range reference name from the specified workbook object if it does exist.
Data in the referenced cells remains unchanged. Multiple names can be specified to be removed.
Use worksheetScope = "" to only target names defined in the global scope.
Author
Martin Studer
Mirai Solutions GmbH https://mirai-solutions.ch
Examples
if (FALSE) { # \dontrun{
# mtcars xlsx file from demoFiles subfolder of package XLConnect
mtcarsFile <- system.file("demoFiles/mtcars.xlsx", package = "XLConnect")
# Load workbook
wb <- loadWorkbook(mtcarsFile)
# Remove the named region called 'mtcars' from the above file
# (this named region is defined as 'mtcars!$A$1:$K$33')
removeName(wb, name = "mtcars")
} # }