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

Free Support Forum - aspose.com

Remove ActiveXControl from Picture shape

Hi,

I was wondering if in Aspose.Cells Java there’s a way to remove ActiveXControl from a Picture shape?
I would like the picture to remain in the worksheet, only without the ActiveX.
I’ve noticed there’s only the getter getActiveXControl() and no setter.
Is there any other way?

@Shiran1,
Thank you for your query.
Could you please share your sample code for our testing? Also perform same task using MS Excel only and share the two files before and after removing the active control from picture shape. We will analyze the information and provide assistance accordingly.

I have a Shape object in my worksheet.getShapes().
This Shape is a picture: shape.getMsoDrawingType() == MsoDrawingType.PICTURE is true.
This Shape contains ActiveXControl: shape.getActiveXControl() == null is false.
I would like to remove the ActiveXControl from the Shape so that the shape will remain only as a picture without the active content.
Is it possible? If yes, how?

@Shiran1,
We need requested files and runnable code. We will analyze the information and provide assistance accordingly.

   Workbook book = new Workbook("C:\\ActiveX.xlsx");
   for (Object sheet : book.getWorksheets()) {
       for (Object obj : ((Worksheet)sheet).getShapes()) {
           Shape shape = (Shape)obj;
           if (shape.getMsoDrawingType() == MsoDrawingType.PICTURE) {
               Picture picture = (Picture)shape;
               ActiveXControl activeX = picture.getActiveXControl();
               // How do I remove the ActiveXControl from picture?
           }
       }
   }
   book.save("C:\\ActiveX2.xlsx", SaveFormat.XLSX);

activex.zip (7.0 MB)

@Shiran1,
Thank you for the sample code.
We have understood the requirement but we need to look into it more. We have logged the issue in our database for investigation and for implementation if possible. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as
CELLSJAVA-43135 – Remove ActiveXControl from Picture shape

@Shiran1,
This is to inform you that we have fixed your issue (logged earlier as “CELLSJAVA-43135”) now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

@Shiran1,
Please try our latest version/fix: Aspose.Cells for Java v20.2.4:
aspose-cells-20.2.4-java.zip (7.0 MB)

Your issue should be fixed in it.

Let us know your feedback.

Thanks for the fix.
It worked for xlsx files but unfortunately didn’t work for xls.

@Shiran1,
We have observed the issue and have logged it with the ticket. We will write back here once any feedback is ready to share.

@Shiran1,
Please try our latest version/fix: Aspose.Cells for Java v20.2.6:
aspose-cells-20.2.6-java.zip (7.0 MB)

Your issue should be fixed in it.

Let us know your feedback.

Working.
Thanks for the fix.

@Shiran1,

You are welcome.

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