user41509
user41509

Reputation: 1040

openxlsx number of worksheets

I'm learning openxlsx in R. I have no problem creating a workbook, adding a worksheet or saving a workbook until I try to save the 4th worksheet I created. Does anyone know if there is a limit on the number of worksheets that can be saved to a workbook created in R using openxlsx? When I try to save the workbook after writing data for the 4th sheet I get this error message: Error in comment_list[[i]] : subscript out of bounds.

Thanks

Upvotes: 1

Views: 1703

Answers (1)

natejena
natejena

Reputation: 11

There is no limit in number of worksheets to any .xlsx

Example:

library(openxlsx)
iris
wb <- createWorkbook()
for (i in 1:8) {
  addWorksheet(wb,i)
  writeDataTable(wb,i,iris)
}
saveWorkbook(wb, 'Exports/prueba.xlsx', overwrite = T)

Upvotes: 1

Related Questions