Hello,
When using Aspose.Cells (Trial version) and loading up a .xlsm file and then calling workbook.Save with a macro enabled .xlsm file no errors occur, but upon opening the file a couple System.Drawing issues force the user to "repair". This issue does not occur when using using Microsoft.Office.Interop.Excel.
Env:
- Running on win 10
- Excel sheet is Excel 2016 .xlsm with embedded macros.
Repaired Records: Drawing from /xl/drawings/drawing1.xml part (Drawing shape)
Repaired Records: Drawing from /xl/drawings/drawing2.xml part (Drawing shape)
Repaired Records: Drawing from /xl/drawings/drawing2.xml part (Drawing shape)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
error019160_02.xmlErrors were detected in file 'C:\FlexiOutputTests\ExportTest\test.output.xlsm' Repaired Records: Drawing from /xl/drawings/drawing1.xml part (Drawing shape)Repaired Records: Drawing from /xl/drawings/drawing2.xml part (Drawing shape)
error019160_02.xml
The code ran in Aspose to repro:
Workbook workbook = new Workbook(destFile);
workbook.Save(sFilePath + ".output.xlsm", SaveFormat.Xlsm);
workbook.Save(sFilePath + ".output.xlsm", SaveFormat.Xlsm);
code in interop that does work with causing the file an issue:
Application excelApp = new Application();
var workbook = excelApp.Workbooks.Open(destFile);
Microsoft.Office.Interop.Excel.Worksheet worksheet = new Microsoft.Office.Interop.Excel.Worksheet();
var workbook = excelApp.Workbooks.Open(destFile);
Microsoft.Office.Interop.Excel.Worksheet worksheet = new Microsoft.Office.Interop.Excel.Worksheet();
worksheet = workbook.Worksheets[1];
workbook.SaveAs(sFilePath + ".output.xlsm", Microsoft.Office.Interop.Excel.XlFileFormat.xlOpenXMLWorkbookMacroEnabled);
workbook.SaveAs(sFilePath + ".output.xlsm", Microsoft.Office.Interop.Excel.XlFileFormat.xlOpenXMLWorkbookMacroEnabled);
excelApp.Quit();