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

Free Support Forum - aspose.com

Disable loading of OLE objects in Excel file

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

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)

@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)

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

@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

Hi @ahsaniqbalsidiqui,

Is there any update on this?
In some of the Excel workbooks we process, we see large (>10 MB) byte[] objects retained in-memory, originating from embedded PDF files, in our specific case.

Since neither Aspose Cells nor the underlying operating system (Linux in our case) can do anything sensible with the OLE content, it would be nice if we could stop wasting memory and garbage collection cycles on content that has no use.

Thanks in advance,
Taras

@TarasTielkes,
This issue is quite complex and still under consideration. I am afraid that no ETA is available yet, however you will be notified immediately once any feedback is ready to share. We have logged your comments with the ticket for our future reference.

@TarasTielkes,

To update you, we are working on your requirements and hopefully, we will provide you fix/version in about three weeks time.

Hi @Amjad_Sahi,

That is good to hear, thank you very much.
I’m looking forward to testing it once a build becomes available.

Kind regards,
Taras

@TarasTielkes,

You are welcome.
Keep in touch.

@TarasTielkes,

Please try our latest version/fix: Aspose.Cells for Java v19.11.3 (attached)

Your issue “CELLSJAVA-43008” should be fixed in it.
We provide a new option for your requirements: LoadDataFilterOptions.OleObject.

Let us know your feedback.
Aspose_Cells_Java_v19.11.3.zip (6.6 MB)

The issues you have found earlier (filed as CELLSJAVA-43008) have been fixed in Aspose.Cells for Java v19.12. This message was posted using Bugs notification tool by ahsaniqbalsidiqui