awalker89 / openxlsx

R package for .xlsx file reading and writing.
Other
364 stars 79 forks source link

Freezing does not work in Excel file with around 15 sheets #550

Open Rengervn opened 1 year ago

Rengervn commented 1 year ago

Expected Behavior

I fill an excel file in a loop over around 15 sheets with data. At the end of each sheet, I add a freezePane command. freezePane(wb, sn, firstActiveRow = 4, firstActiveCol = 7) and after the loop save it. I expect the sheets are frozen at 4,7

Actual Behavior

No freezing takes place

Steps to Reproduce the Problem

(please attach an example xlsx file if possible)

Just run the following code wb <- loadWorkbook(file = "temp.xlsx") sectors <- getSheetNames(file = "temp.xlsx") for (sn in sectors) { freezePane(wb, sn, firstActiveRow = 4, firstActiveCol = 7) } saveWorkbook(wb, file = "temp.xlsx", overwrite = T)

Cheers Renger

sessionInfo()

Rengervn commented 1 year ago

With smaller excel files, freeze works fine.