No XLS SaveFormat when saving to Stream

Hi,


I’ve been looking into processing files that are passed into my assembly as streams, this is working well for most files so far but there is an odd issue I have come across when using the Aspose Cells library in conjunction with saving to streams.

If I pass in an XLSX document, it is processed and returned fine, but when I pass in an XLS document, there is no SaveFormat enum for an XLS document, so I have to use SaveFormat.Xlsx which then shows an error when the end user attempts to open it since the file type has technically been changed…is there no support for saving XLS files to streams or is there a workaround to achieve this?

Currently, my save code are just the two lines below:

var ms = new MemoryStream();
workbook.Save(ms, SaveFormat.Xlsx);

Thanks!
Jak

Hi,

Thanks for your posting and using Aspose.Cells.

XLS is actually Microsoft Excel 97-2003 format, it is an old format. So we have defined SaveFormat.Excel97To2003 which actually means XLS format. Once you will use it your workbook will be saved in XLS format.