We would like to remove grid lines in xlsx files with R. This works fine. However, formats are changed. What can we do that the formats are not changed?
#packages
library(zip)
library(openxlsx)
#input
pathInput <- "https://www.stadt-zuerich.ch/content/dam/stzh/prd/Deutsch/Statistik/Themen/Bevoelkerung/BEV322T3220_Auslaenderanteil_Bevoelkerung_nach-Herkunft-Geschlecht.xlsx"
wb <- loadWorkbook(pathInput)
names(wb)
#no grid lines
showGridLines(wb, "1901 – 2019", showGridLines = FALSE)
#output
pathOutput <- "H:/temp/Output.xlsx"
saveWorkbook(wb, pathOutput, overwrite = TRUE)