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

Free Support Forum - aspose.com

Run vba codes/macros in Excel Workbook in .NET

There is macro in one of the modules of the workbook, I need to execute it passing some parameters .

How can I do this??


Hi,

Thank you for considering Aspose.

Well, Aspose.Cells does not support to manipulate / execute the macros. Currently, we only preserve any macros present in the excel file.

Thank You & Best Regards,

I am using Aspose.Cells version 4.7.1.0, existing macros in the template are not being preserved, please help.

Thanks, Adi

Hi,

Thank you for considering Aspose.

Please download and try the latest version of Aspose.Cells from the following location and see if it works fine for you.

http://www.aspose.com/community/files/51/.net-components/aspose.cells-for-.net/entry215207.aspx

If you still face any problem, please share your template file and sample code here and we will check it soon.

Thank You & Best Regards,

Hi,

the newer version does not work either, please find the template and code attached.

thanks, Adi

Hi,

Thank you for considering Aspose.

Well, currently Aspose.Cells does not support to save the VBA codes of xls file to xlsx file. If you want to save / preserve the VBA codes, you need to save the file in the same format as the template file. We have added this enhancement in our internal issue tracking system with issue id CELLSNET-13198 and we will support it in our future release.

Thank You & Best Regards,

Thanks for the guidance, I am saving a template.xlsm to output.xlsm, this works well for me.

thanks, Adi

Hi,

Thanks for using Aspose.Cells.

We only plan to create, manipulate or embed VBA codes/ macros later. We however cannot support to run or execute macros. Does it fit your needs?