Free Support Forum - aspose.com

ActiveX not detected in Java Cells

Hi,

The attached files contains ActiveX however I couldn’t find a way to detect it.
getActiveXControl() of the relevant Shape returns null.

activex.zip (21.4 KB)

@Shiran1,

Thanks for the zipped archive containing the file.

I tried to evaluate your issue a bit but it looks like your file is corrupt. My antivirus detected some malware when I extracted the zipped archive. Please provide us clean and valid MS Excel file, so we could evaluate your issue precisely.

Hi Amjad,
Thanks for your response.
The file is not corrupt and it is opened with no errors by Excel.
The file was created from an original file that might be malicious. I believe it is no longer malicious but for some reason Kaspersky antivirus still detects it as malicious. Maybe you could open it in a VM or some secured environment without the interference of antivirus.
Regardless, since it is a valid Excel file I would expect Aspose to detect the the ActiveX.
I’m attaching an xlsx I created simply by “save as” of the original xls in Excel. Note that in this file the ActiveX is detected.
Seems to me like there might be a bug in detecting ActiveX in xls files.

activex.zip (16.0 KB)

@Shiran1,
I have tried your sample file but could not observe any issue as it identifies the ActiveX control using following sample code. Could you please give it a try using the latest version of Aspose.Cells for Java v19.12.4 and share the feedback.

Workbook workbook = new Workbook(path + "activex.xlsx");
for(Object obj: workbook.getWorksheets())
{
	Worksheet worksheet = (Worksheet)(obj);
	for(Object shp:worksheet.getShapes())
	{
		Shape shape = (Shape)shp;
		
		ActiveXControl ct = shape.getActiveXControl();
		System.out.println("ActiveX control found");
	}
}		

aspose-cells-19.12.4-java.zip (6.8 MB)

@ahsaniqbalsidiqui
As I said in my previous message, the ActiveX in the xlsx file (second attachment) is detected.
However, the problem is in the xls file (first attachment) where it isn’t.

@Shiran1,

I could not open your original Excel file into MS Excel 2007/2013 as it is corrupted. Even Windows Defender takes it as malware. Could you try re-saving your XLS file (if you are able to open into your MS Excel) in MS Excel manually, zip the file and provide us, we will check it soon.

I’m opening the file using Excel 2016 and got no indication of error.
I also see the “Enable content” warning bar for ActiveX when I open the file.
You could also try running your sample code on the file and see that the workbook is opened properly with no exception and the getActiveXControl() for the shape that contains the ActiveX returns null

@Shiran1,

We will check it using MS Excel 2016 soon. In the mean time, as requested earlier, could you try re-saving your XLS file in MS Excel manually, zip the file and provide us.

I attached a new version that was created by manually saving in Excel.
I get the same results.
activex.zip (15.4 KB) Password: infected

@Shiran1,

Thanks for the template file.

After an initial test, I am able to reproduce the issue as you mentioned by using your template file and following sample code. I found ActiveX control is not detected in the XLS file format, it works fine if XLSX file is used:
e.g
Sample code:

Workbook workbook = new Workbook("f:\\files\\activex2.xls");
        for(Object obj: workbook.getWorksheets())
        {
            Worksheet worksheet = (Worksheet)(obj);
            for(Object shp:worksheet.getShapes())
            {
                Shape shape = (Shape)shp;

                ActiveXControl ct = shape.getActiveXControl();
                if(ct==null)
                {
                    System.out.println("ActiveX control not found");    

                }
                else {
                    System.out.println("ActiveX control found");
                }

            }
        }

I have logged a ticket with an id “CELLSJAVA-43093” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

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

Your issue should be fixed in it.

Let us know your feedback.

The fix works for me. Thanks!

@Shiran1,

Good to know that your issue is sorted out by the new fix/version. Feel free to contact us any time if you need further help or have some issue or queries, we will be happy to assist you soon.

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