Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

namedRegion and table names clash #192

Open
JanMarvin opened this issue May 22, 2022 · 0 comments
Open

namedRegion and table names clash #192

JanMarvin opened this issue May 22, 2022 · 0 comments
Labels
bug 🐛 Something isn't working enhancement 😀 New feature or request

Comments

@JanMarvin
Copy link
Owner

Even though they are handled separately in openxml, it is impossible to have identical names for tables and regions (our name for definedName). A check should be added, when creating a table or a defined name. Maybe something like wb_named_region_validate() that breaks if either name is found. It's a bit unfortunate that the table names are burried in wb$tables$tab_xml.

wb <- wb_workbook()
# add a table to the sheet
wb$add_worksheet("Sheet 1")
wb$add_data_table(sheet = "Sheet 1", x = iris, tableName = "iris")
# add a named region to the sheet: names clash the file is broken
wb$add_worksheet("Sheet 2")
wb$add_named_region(
  sheet = 2,
  name = "iris",
  rows = seq_len(nrow(iris) + 1),
  cols = seq_along(iris)
)
@JanMarvin JanMarvin added enhancement 😀 New feature or request bug 🐛 Something isn't working labels May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working enhancement 😀 New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant