Incorrect formatting of Shape objects (2682)


I am writing to you about a problem we encountered in working with MSO Excel documents (.xls format) using the Aspose Cells v20.10 library.

Specifically, when we open the document and close it immediately afterwards, there is a disturbance on the Shape objects.

If you look at the source document (left in the attached picture), you can notice 5 Shape objects (2 RadioButton objects within the GroupBox object which are connected to the TextBox object by one LineShape object in the form of an arrow) on it. The same objects can be seen on the target document (right in the attached picture), but their formatting and text are lost or totally different.
In addition to the above, you may notice that the title of the table is not same (row 6), ie. it loses text formatting.

I enclose a test code that reproduces the specified behavior, test source and target files, as well as a comparative image of the source and target document.

In the hope that together we will quickly overcome the problem!
Best regards!


Test code, XLS files and (64.5 KB)

We have observed the issue using the latest version Aspose.Cells for Java 21.5.x and logged it in our database for further investigation. You will be notified here once any update is ready for sharing.

This issue is logged as:
CELLSJAVA-43474 - Shape objects changed while loading and saving XLS file


We found your file is Excel95/5.0 file. We have fixed the problems mostly. Please check the attached image
5.png (1.9 KB)

But the text of the groupbox is “Unité” in the file, it shows “Unit?” in my machine, and it’s different from your machine too.

@ahsaniqbalsidiqui @Amjad_Sahi

Thanks to both!

I guess we’ll get over this issue soon! Regard!



Yes, we will soon provide you the fixed version for your testing.

Please try the latest fix 21.5.5.
We have fixed the problems mostly except the text of Groupbox.


We checked the fix. The form is good, but the functionality is not. Radio buttons do not switch the content as they should. Also, the order and ids (specifically with the radio buttons) defined during creating the source document are not consistent on the target document.


You are right. There is still an issue as radio buttons are not mapped with linked cell properly and hence do not update/switch the contents or data accordingly in the below tables. I have reopened the ticket and we will be looking into it soon.


We have fixed the issue of linked cell now.
Could you explain more about “Also, the order and ids (specifically with the radio buttons) defined during creating the source document are not consistent on the target document”, so we could understand the issue properly and then figure it out soon.


Every Shape object used, ie. imported into the document, including special functional forms from the category Developer > Controls > Insert > Form Controls where RadioButton and GroupBox are located, gets its ID (numeric value starting from 1) which refers to the ordinal number of the imported Shape object (you can get it by calling your method “shape.getId()”).
This functionality does not work properly if we look at the document we sent you when we reported the issue (specifically for RadioButton objects, the one with the value “kJ” reads first, and the one with the value “kcal” should read)

In addition to this, we are still reproducing the problem with switching the cells content when using RadioButton objects.

If it is helpful we use:

  • Linux Ubuntu 18.04 LTS
  • Java 11
  • Aspose Cells 21.6



We have observed the issue and logged it with the ticket for testing with the fixed version.

Regarding the Id issue, I have tried to reproduce it but could not succeed. Please share detailed steps to observe this issue here. I tried it with the following sample code and got the same result.

Workbook workbook = new Workbook("formatShapeIssue.xls");
Shape shape1 = workbook.getWorksheets().get(0).getShapes().get(0);
Shape shape2 = workbook.getWorksheets().get(0).getShapes().get(1);
Workbook workbook2 = new Workbook("output.xls");
shape1 = workbook2.getWorksheets().get(0).getShapes().get(0);
shape2 = workbook2.getWorksheets().get(0).getShapes().get(1);

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

A post was split to a new topic: Shape text font size issue while saving and loading XLS file