Free Support Forum - aspose.com

Fails to save to Strict format

Hi

private static byte[] ConvertSpreadSheet(Stream sm)
    {
        var fileFormat = CheckExcelFormat.Run(sm);
        if (string.IsNullOrEmpty(fileFormat)) return null;
        _extension = fileFormat.ToLower();

        using (var docStream = ConvertStreamToMemoryStream(sm))
        {
            docStream.Position = 0;
            var wb = new Workbook(docStream, new Aspose.Cells.LoadOptions(Aspose.Cells.LoadFormat.Auto));

            var ws = wb.Worksheets[0];
            ws.PageSetup.PrintGridlines = true;
            ws.AutoFitColumns();
            var outMs = new MemoryStream();

            switch (fileFormat.ToLower())
            {
                case "xls":
                case "xlsx":
                    var complianceOptions = new Aspose.Cells.OoxmlSaveOptions(Aspose.Cells.SaveFormat.Xlsx);
                    wb.Save(outMs, complianceOptions);
                    _extension = "xlsx";
                    break;

                default:
                    return null;
            }

            outMs.Position = 0;
            return outMs.ToArray();
        }
    }

Any Excel spreadsheet - Fails to save Excel to Strict format

@mikesoffice,

Thanks for the sample code and details.

I think you want to save an Excel file to Open Strict XML spreadsheet format, it not it? Well, I am afraid, the feature is not supported at the moment. We have already logged a ticket with an id “CELLSNET-46023” for it as following:
CELLSNET-46023 - Support Strict Open XML Spreadsheet format

We might need 2-3 weeks to support it. Once we have an update on it, we will let you know here.

@mikesofficen,

This is to inform you that we have fixed your issue “CELLSNET-46023” now. We will soon provide you the fix after performing QA and including other enhancements and fixes.

Hi

Been on holiday and was just wondering has there been any progress been made?

Regards, mike

@mikesoffice

Please download and try the following fix and let us know your feedback.


Please see the following sample code and screenshot for your reference. It saves the Excel file in Strict Open XML Spreadsheet format.

C#

//Create workbook.
Workbook wb = new Workbook();

//Specify - Strict Open XML Spreadsheet.
wb.Settings.Compliance = OoxmlCompliance.Iso29500_2008_Strict;

//Save to output Excel file.
wb.Save("Out.xlsx");

Screenshot:

The issues you have found earlier (filed as CELLSNET-46023) have been fixed in this update. Please also check the document/article for your reference: https://docs.aspose.com/display/cellsnet/Installation