library(dplyr)
library(openxlsx)
channels <- tribble(
~channel, ~homepage,
"ABC", "https://www.abc.net.au/",
"BBC", "https://www.bbc.com/",
"CBC", "https://www.cbc.ca/"
)
channels <- channels |>
mutate(formula = paste0(
'=HYPERLINK("',
homepage,
'", "',
channel,
'")')
)
wb <- createWorkbook()
addWorksheet(wb, "channels")
writeDataTable(wb, "channels", channels, tableName = "channels")
writeFormula(wb, "channels", channels$formula, startRow = 2, startCol = 1)
freezePane(wb, "channels", firstRow = TRUE)
setColWidths(wb, "channels", cols = 1:ncol(channels), widths = "auto")
saveWorkbook(wb, file = here::here("temp", "channels.xlsx"), overwrite = TRUE)
Describe the bug
I found an issue when writing an hyperlink formula (
writeFormula) after upgrading theopenxlsxfrom 4.2.3 -> 4.2.4.To Reproduce
Here is an example code:
Screenshots
screenshot when using 4.2.3 (desired outcome):
screenshot when using 4.2.4