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

[write_data] escape all formulas in write_data #834

Merged
merged 2 commits into from Oct 29, 2023
Merged

Conversation

JanMarvin
Copy link
Owner

This solves an issue described in this SO thread. Previously data frame formulas were not xml escaped.

library(openxlsx2)

df_tmp <- data.frame(
  f = paste0("'A&B'!A1")
)
class(df_tmp$f) <- c(class(df_tmp$f), "formula")

wb <- wb_workbook()$
  add_worksheet("A&B")$
  add_worksheet("Fml")$add_data(x = df_tmp, col_names = FALSE)

if (interactive()) wb$open()

@JanMarvin JanMarvin merged commit f19a5b5 into main Oct 29, 2023
9 checks passed
@JanMarvin JanMarvin deleted the escape_fml_xml branch October 29, 2023 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant