I am trying to import an xlsx worksheet for which I need to read the cell color. I already read this post ( Using R to read out excel-colorinfo) but I can't import the Excel file as workbook, which I understood would be a requirement to then read the cell color.
It is an xlsx file with many sheets, some of which contain thousands of rows and many columns.
The problem is that when I try
library(XLConnect) options(java.parameters = "-Xmx1024m") wb <- loadWorkbook("My_file.xlsx")
After a minute I get the following error
Error: OutOfMemoryError (Java): Java heap space
I also tried what is suggested in this post (Importing a big xlsx file into R?), but it did not seem to work either and I can not use a simple read.xlsx
function because I need a WorkBook format to read the cell colors.
I also tried to copy paste the sheet I am interested in another Excel-file and then read that. Since it was a smaller file, I hoped it worked. But I got another error:
wb <- loadWorkbook("test_wb.xlsx", create = F) Error: NoSuchMethodError (Java): org.apache.poi.ss.usermodel.FillPatternType.getCode()S
Any suggestion from your side?