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

Free Support Forum - aspose.com

Save large XSLM files using LightCellsDataProvider in aspose.cells

Hi,

I can able to save XSLX file using LightCellsDataProvider in Aspose.cells.

Can you tell how to save same file XSLM format which keeps macro.

Thanks

Shrikant

Hi,


See the document:
http://www.aspose.com/docs/display/cellsjava/Using+LightCells+API

I think you may change the last lines of code to if it works:
e.g

 //Specify the XLSM file's Save options
	OoxmlSaveOptions opt = new OoxmlSaveOptions(SaveFormat.XLSM);
	//Set the data provider for the file
        opt.setLightCellsDataProvider(dataProvider);
<span class="code-comment" style="color: rgb(128, 128, 128); background-color: inherit; ">//Save the big file

wb.save(OUTPUT_FILE_PATH + “/DemoTest.xlsm”, opt);

Amjad,

Thanks for the quick reply. I can able to save XSLM file.

But is there any way we can save the same file in old XSL format ?

I tried all way to create large XSL file using LightCellsDataProvider since i use normal way to , it throws OutofMemory above 6ooo rows.

I want to create XSL file with 65K rows and 256 Columsn

and XSLX and XSLM file with 200K rows.

Please suggest

Shrikant

Hi,


"But is there any way we can save the same file in old XSL format ?

I tried all way to create large XSL file using LightCellsDataProvider since i use normal way to , it throws OutofMemory above 6ooo rows.

I want to create XSL file with 65K rows and 256 Columsn"

You mean XLS file format of Excel, yes, you may create the file in light mode.
e.g, you may change your lines of code to:
 //Specify the XLS file’s Save options
XlsSaveOptions opt = new XlsSaveOptions();
//Set the data provider for the file
opt.setLightCellsDataProvider(dataProvider);
<span class="code-comment" style="color: rgb(128, 128, 128); background-color: inherit; ">//Save the big file

wb.save(OUTPUT_FILE_PATH + “/DemoTest.xls”, opt);


But, we still recommend you to use XLSX (which is more compact file fomrat) or Excel 2007/2010 formats as for XLS file format is older, it may consume more memory and take more time. If you persists with XLS, please make sure you have allotted sufficient amount of memory to JVM, otherwise you will get out of memory exception.

Also for XLS, you can have upto 65536 rows and 256 columns in a worksheet, if you want to do such huge list of XLS, it would demand lots of memory for the big process.

Thank you.

Hi,

Thanks for using Aspose.Cells.

When saving large XLS files, it is better for users to use SaveOptions.CachedFileFolder to specify a temporary place for saving temporary data generated in saving process. Otherwise lots of memory will be needed even using LightCells because of XLS file’s data structure.

Hi,

Thanks for using Aspose.Cells.

For detailed information regarding LightCells API(s) and its interface, please see the following documentation topics.