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

Free Support Forum - aspose.com

Why Aspose.cells change macro to worksheet ? how can I keep macro no change?

I create a Excel template which include a macro, when I export data to the template, Aspose.cells change marco to worksheet, how can I keep marco no change?

This message was posted using Aspose.Live 2 Forum

No, we won’t change macros. Could you provide a sample file and code to reproduce your problem?

I upload a file, it include macro and worksheet

My code:

Dim license As Aspose.Cells.License = New Aspose.Cells.License
Dim excel As Workbook = New Aspose.Cells.Workbook
Dim Path As String = MapPath(".")
Dim ExcelFile As String = Path + "\\ExportData.xls"
Dim sheet As Worksheet = excel.Worksheets(0)
sheet.Name = "Data"
sheet.Cells.ImportDataTable(DataTable, False, 2, 0)
excel.Save("ExportData.xls", Aspose.Cells.SaveType.OpenInExcel, Aspose.Cells.FileFormatType.Default, Me.Response)

My aspose.cells.dll version is


Please try this fix.

The type of macro is Excel version 4.0 Macro. We have support to save it to the file and not change it.