We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Unable to load workbook with large sheet

Hello. We caught a bug in Aspose.Cells 20.3 (it also produces in 20.4) with loading XLSM file with large sheet.

Stacktrace (Aspose.Cells 20.4):

Exception in thread "main" java.io.IOException: Invalid stream settings, cannot get entry [docProps/core.xml]
	at com.aspose.cells.a.f.zg.c(Unknown Source)
	at com.aspose.cells.a.f.zj.a(Unknown Source)
	at com.aspose.cells.zbcm.a(Unknown Source)
	at com.aspose.cells.ze.t(Unknown Source)
	at com.aspose.cells.ze.a(Unknown Source)
	at com.aspose.cells.zaql.a(Unknown Source)
	at com.aspose.cells.zjy.a(Unknown Source)
	at com.aspose.cells.zjy.a(Unknown Source)
	at com.aspose.cells.Workbook.a(Unknown Source)
	at com.aspose.cells.Workbook.<init>(Unknown Source)
	at LargeTemplateMain.main(LargeTemplateMain.java:18)

Code snippet:

public class LargeTemplateMain {
    public static void main(String[] args) throws Exception {
        License license = new License();
        license.setLicense("aspose.lic");

        FileInputStream fileInputStream = new FileInputStream("LargeTemplateTest.xlsm");
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(IOUtils.toByteArray(fileInputStream));
        new Workbook(byteArrayInputStream);
    }
}

Code snippet 2 (bug not reproducing because another stream type used):

public class LargeTemplateMain {

    public static void main(String[] args) throws Exception {
        License license = new License();
        license.setLicense("aspose.lic");

        FileInputStream fileInputStream = new FileInputStream("LargeTemplateTest.xlsm");
        new Workbook(fileInputStream);
    }

}

I can’t attach template because it’s private and I have no permissions for do this.
After further investigation I found that problem caused by InputStream with markSupported()==true.

As workaround I found that we can wrap our InputStream to another which return false in markSupported method. But we worried that with this workaround we get new problems with increased memory consumption. What do you think about this?

P.S. This error start cause for us after upgrade 19.10 --> 20.3
P.S. We caught this bug on Java 8 (production environment) and I reproduced it on Java 11 at local station.

@VasiliyKupchinskiy,
We need the template file for testing purpose. You can populate dummy data in the template file otherwise it will be safe with us even if you do not modify it. You can send me data through a private message by clicking on my name icon (circled pink A) and then pressing the Message button. If attachment size is large, please upload it to some public file sharing service like Dropbox or Google Drive and share the link with me through this message. I will download the file and use it to test the scenario.