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

Free Support Forum - aspose.com

Excel extracting OleObjects

Hello,
I am evaluating APOSE Cells for purchase but I’ve hit a brick wall.

I am trying to detach all OLE embedded documents from an excel file using JAVA

(following this sample)
https://docs.aspose.com/display/cellsnet/Managing+OLE+Objects

The link points to an example using C# and JAVA to insert an object but the example shows only
shows C# detaching files (not java )

Is there anyway to detach embedded OLE objects from an excel file using JAVA?

Thanks in advance,
Enrique



Hi,

Thanks for your inquiry.

Well, I 'm afraid the feature (extraction of oleobjects) not fully supported for Java version of the product as there are still some issues involved regarding oleobject data (as we tested). We will look into it soon to implement it. We have updated the doc topic to include the parallel Java code: https://docs.aspose.com/display/cellsjava/Managing+OLE+Objects for the users.

Thank you.

Hi Amjad,

Do you have any news about the issue?

Best Regards, Evgeniy

Hi,

Thanks for following up

We will update you soon.

Thank you.

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />


Thank you for considering Aspose.

Please try the attached latest version of Aspose.Cells. Now, we have supported to read OleObject's data from template file and you can use OleObject.getObjectData() to get data of the OleObject:

FileOutputStream fos = new FileOutputStream(filename);

byte[] data = ole.getObjectData();

fos.write(data);

fos.close();

Thank You & Best Regards,

Hi Nausherwan,

With the attached version of Aspose.Cells this works, thank you!

When the feature will be included into the official release?

Best regards, Evgeniy

Hi Evgeniy

Well, you can use this fix as an official release. It is an intermediate kind of version which is provided as a fix against some bugs/new features. Normally, this kind of version is posted in the support forums. You can use this version for your requirements; it will behave like an official release. It is to be noted here, our next official release would include all the functionality of the previous fixes (including all the intermediate versions till the next official release).

Anyways, we will provide an eta for the next official release soon.

Thank you.

Hi,

Hopefully, we can release our next official version for Java before the end of this week or in the next week.

Have a good day!

The issues you have found earlier (filed as CELLSJAVA-7900) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi,


I am trying to detach one of the oleobject using oleobject index. My excel has several oleobjects and I am able to find the objects which are present in a particular cell. OleObjectCollection.removeAt(oleObjectIndex) does not seem to be working. Please find the code below

//Get the image file.
File file = new File(“c:\Aspose\icon.gif”);
//Get the picture into the streams.
byte[] img = new byte[(int)file.length()];
FileInputStream fis = new FileInputStream(file);
fis.read(img);

//Get the txt file into the streams.
file = new File(“c:\Aspose\a.txt”);
byte[] data = new byte[(int)file.length()];
fis = new FileInputStream(file);
fis.read(data);

//Instantiate a new Workbook.
Workbook wb = new Workbook();
//Get the first worksheet.
Worksheet sheet = wb.getWorksheets().get(0);

//Add an Ole object into the worksheet with the image
//shown in MS Excel.
int oleObjIndex = sheet.getOleObjects().add(15, 15, 20, 20, img);
OleObject oleObj = sheet.getOleObjects().get(oleObjIndex);
oleObjIndex = sheet.getOleObjects().add(10, 15, 20, 20, img);
OleObject oleObj1 = sheet.getOleObjects().get(oleObjIndex);
oleObjIndex = sheet.getOleObjects().add(5, 15, 20, 20, img);
OleObject oleObj2 = sheet.getOleObjects().get(oleObjIndex);

//Set embedded ole object data.
oleObj.setObjectData(data);
oleObj.setNativeSourceFullName(“a.txt”);
//Set embedded ole object data.
oleObj1.setObjectData(data);
oleObj1.setNativeSourceFullName(“b.txt”);
//Set embedded ole object data.
oleObj2.setObjectData(data);
oleObj2.setNativeSourceFullName(“c.txt”);

OleObjectCollection abc = sheet.getOleObjects();
System.out.println(abc.getCount()); – Output is 3 here
abc.removeAt(0);
System.out.println(abc.getCount()); – Output is 2 here
//Save the excel file
wb.save(“c:\Aspose\output2.xlsx”, SaveFormat.XLSX);


The count of objects is changing but it still remains in the excel file. I am using 7.7.2 version. Please advice

Thanks
Lokesh

Hi,

Thanks for your posting and using Aspose.Cells for Java.

We were able to observe this issue using your code with the latest version: Aspose.Cells for Java (Latest Version) OleObjectCollection.removeAt() does not remove the OLE object. We have attached the output xlsx file for a reference.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSJAVA-40778.

Hi,


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

We have fixed your issue now.

Let us know your feedback.

Thank you.

The issues you have found earlier (filed as CELLSJAVA-40778) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.