Is it possible to hide all rows in a worksheet after a specified row?
library("openxlsx")
# Create a workbook.
wb <- createWorkbook()
# Add a worksheet.
addWorksheet(wb, sheetName = "test", gridLines = FALSE)
# "Hide" all rows after row 37.
setRowHeights(wb, 1, 38:1048576, 0)
# Write workbook.
saveWorkbook(wb, "test.xlsx", overwrite = TRUE)
# inspect file size.
file.info("test.xlsx")
# size isdir mode mtime ctime atime exe
# test.xlsx 2621280 FALSE 666 2018-09-13 14:54:10 2018-09-13 14:54:07 2018-09-13 14:54:07 no
Seems very inefficient and seems to make the output extremely large (and slow when trying to open it in Excel). I assume it's not hiding it and in fact just changing row heights to be 0?
hidden
isn't implemented forsetRowHeights
, retracting my vote to close – Hebbehidden
attribute for rows like it works for columns, but I'm not sure if simply setting the attribute is enough. This is how it's set for columns:attr(wb$colWidths[[sheet]], "hidden") <- as.character(as.integer(hidden))
– Hebbescrollarea
option. It's possible to pass a VBA script toshell()
if you want to keep everything in R – Hebbe