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

Free Support Forum - aspose.com

File is still infected after remove VBA macro

While evaluating the Aspose Cells product, I got a sample that has problem with VBA macro. The original file is a virus file which is detected by several engines. You can see here: here

I tried to use Aspose Cells to delete the VBA project but the result is still infected. The API I used is RemoveMacro(). The result file is: here

Here is sample file: 49CD7DAFE42977DF67DE4FF7AB84E77A83B0932107E3979CEBAA82C9150DD157.zip (67.5 KB)

The password is: 123

I used lastest version of Aspose Cell Dot NET : 20.9.

My question is: how can I remove VBA macro completely from the original file? I tried all the API but the result is still infected.

Thank you


First thing to evaluate your issue which I have to do is disable my antivirus and then download and extract your file. I then checked your file and it is corrupt. MS Excel did prompt error messages and has to open it without macros/vba codes. I noticed, same thing is done via Aspose.Cells APIs. I used the following sample code to check if it has macros in it. Aspose.Cells does not detect macros/vba codes in it, so there is no question of removing macros as Aspose.Cells would read the file without macros/vba codes after all:
Sample code:

Workbook workbook = new     Workbook("e:\\test2\\49CD7DAFE42977DF67DE4FF7AB84E77A83B0932107E3979CEBAA82C9150DD157.xls");
                if (workbook.HasMacro) //evaluate to "false"
                    workbook.RemoveMacro();//this line won't be processed.