OoxmlSaveOptions saveOptions = new OoxmlSaveOptions(SaveFormat.Auto);
if (Environment.Is64BitProcess)
saveOptions.EnableZip64 = true;
workbook.Save(OUTPUT, saveOptions);
}
public Workbook OpenWorkbook(out FileStream fileStream)
{
string workbookPath = SOURCE;
fileStream = new FileStream(workbookPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete);
LoadOptions lo = new LoadOptions(LoadFormat.Auto);
lo.MemorySetting = MemorySetting.MemoryPreference;
lo.LoadFilter = new LoadFilter(LoadDataFilterOptions.All);
return new Workbook(fileStream, lo);
This contradicts to the description of the SaveFormat.Auto member: “If saving the file to the disk, the file format accords to the extension of the file name. If saving the file to the stream, the file format is xlsx.”
I save the file to disk and the file extension is .XLSM. Accordingly, I expect that the resulting file is a valid XLSM. Moreover, the code uses SaveFormat.Auto for quite a while and I see that 18.2.4 works exactly as described.
@AndreiSmolin
Thank you for your feedback. We also noticed the API instructions for SaveFormat.Auto. Through testing, we can reproduce the issue and found that when using SaveFormat.Auto, the result file crashes after resaving xlsm file.
The sample code as follows:
Workbook workbook = new Workbook(filePath + "Book1.xlsm");
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions(SaveFormat.Auto);
workbook.Save(filePath + "out_net.xlsm", saveOptions);
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-55218
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
This is to inform you that your issue (logged earlier as “CELLSNET-55218”) has been resolved. The fix/enhancement will be included in the next release (Aspose.Cells v24.3) scheduled for release this week or next week in March. You will be notified when the next version is published.
The issues you have found earlier (filed as CELLSNET-55218) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi