Hello @ahsaniqbalsidiqui/@Amjad_Sahi,
I have an excel with macro enabled document. I am trying to make changes to the file and saves it using
book.Save(filePath, SaveFormat.Xlsm);
After saving the file format becomes not supported and when I am trying to read that changed file, I am getting the mentioned error.
Please find the files before and after the modification in the attachements.
Real-Time Work Order_Update.zip (1.9 MB)
@rajeeshkv,
Thanks for the template file.
Which version of Aspose.Cells for .NET you are using? Please try using our latest version/fix: Aspose.Cells for .NET 22.5 (Download | NuGet).
I tested using your template XLSM file with the following sample code using latest version and it works fine. I do not get the exception when loading the saved XLSM file into Aspose.Cells object model:
e.g.
Sample code:
Workbook workbook = new Workbook("e:\\test2\\Real-Time Work Order_Update_BEFORE_CHANGE.xlsm");
workbook.Save("e:\\test2\\out1Real-Time Work Order_Update1.xlsm", SaveFormat.Xlsm);
Workbook workbook1 = new Workbook("e:\\test2\\out1Real-Time Work Order_Update1.xlsm");
Console.WriteLine("done");
If you still find the issue with latest version, kindly do share your sample code (runnable) to reproduce the issue on our end, we will check it soon.