Disable loading of OLE objects


#1

Hi,

Using Aspose Cells for Java, 19.8.

Some of the workbooks we are loading contain embedded OLE objects. For example, embedded Adobe Acrobat PDF files. Quite often we are only interested in the cell data, and loading such embedded objects incurs a memory usage penalty.

I would expect LoadDataFilterOptions to contain a flag to control whether Aspose Cells will read OLE object streams into memory, but such a flag seems to be absent.

Please consider adding such an option, since it will allow us to have more sensible memory usage when loading workbooks without caring about embedded objects (which can be huge), and don’t need to be accessed in the large majority of our use cases.

Kind regards,
Taras


#2

The attached screenshot shows the reference graph retaining the binary content of a sample OleObject loaded as part of the workbook:
aspose-cells-19.8-OleObject-reference-chain.png (17.3 KB)


#3

@TarasTielkes,
You may please try using LoadDataFilterOptions.CHART and SHAPE to filter the OLE objects as shown in the following example. If it does not fulfil your requirements, please share your sample file for our testing.

LoadOptions loadOptions = new LoadOptions();
loadOptions.setLoadFilter(new LoadFilter(LoadDataFilterOptions.ALL & ~LoadDataFilterOptions.CHART & ~LoadDataFilterOptions.SHAPE));
Workbook workbook = new Workbook("sampleExtractOLEObjects.xlsx",loadOptions);
System.out.println(workbook.getWorksheets().get(0).getOleObjects().getCount());

sampleExtractOLEObjects.zip (113.4 KB)


#4

Hi @ahsaniqbalsidiqui,

Thank for the response. I am aware that LoadDataFilterOptions has the CHART and SHAPE flags.
However, in our use-case, we do need to load the regular charts and shapes that are present in the workbook, since we are exporting these through HTML and or PDF formats, using Aspose Cells.

So, while disabling the CHART and SHAPE flags would prevent loading some OLE objects, it would also prevent loading the normal (i.e. without OLE attached OLE object) charts and shapes that we are interested in.

Kind regards,
Taras


#5

@TarasTielkes,
Thank you for the feedback. We have understood your requirement but need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as
CELLSJAVA-43008 – Option to disable loading OLE object while opening a workbook