Hi,
There’s a parseSheet method in XSSFWorkbook (the relevant class if you’d like 
to read/update xlsx). You could possibly subclass XSSFWorkbook and then 
override parseSheet to not call onDocumentRead() for the sheets you are not 
interested in based on their names. I haven’t tried it myself, and the 
community possibly have a much neater solution, but you might want to spend a 
few minutes to see if you can get it to work.

See code for the (default) implementation of parseSheet:

        public void parseSheet(Map<String, XSSFSheet> shIdMap, CTSheet ctSheet) 
{
                XSSFSheet sh = shIdMap.get(ctSheet.getId());
                if(sh == null) {
                        logger.log(POILogger.WARN, "Sheet with name " + 
ctSheet.getName() + " and r:id " + ctSheet.getId()+ " was defined, but didn't 
exist in package, skipping");
                        return;
                }
                sh.sheet = ctSheet;
                sh.onDocumentRead();
                sheets.add(sh);
        }


Best of luck,
Markus


> On 07 Jul 2016, at 10:41, Marek Slama <msl...@email.cz> wrote:
> 
> Hi,
> 
> I have workbook with ~ 10 sheets. Some of them are quite big. I need to 
> update just one. Is it possible to load given sheet on request ie. not to 
> load whole workbook model? (provided I have no links/dependency between 
> sheets). Is it possible in principle? I want to ask before I try to dig into
> code. Then on write I would save only sheets which are loaded. (main reason 
> for this is memoru usage and also performance as creating complete model 
> takes long).
> 
> I read some questions/discussions regarding this but it was lazy loading on 
> row level. I think on sheet level it might be easier as sheets are separated
> in xlsx file.
> 
> Thanks
> 
> Marek
> 

Reply via email to