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