is it possible to determine the file format when I open an excel document from a stream?
Or is is possible to save the document in the format to a stream, which the document was loaded?
is it possible to determine the file format when I open an excel document from a stream?
Or is is possible to save the document in the format to a stream, which the document was loaded?
Hi,
Thanks for your question and considering Aspose.Cells.
Please download and use the latest version:
Aspose.Cells
for .NET v7.3.1.3
Yes, it is possible to detect the file format from stream. Please use
CellsHelper.DetectFileFormat(Stream stream)
Similarly, you can save your workbook into a stream. Please use.
Workbook.Save(Stream stream,SaveFormat saveFormat)
Hi,
Thanks for your quick help.
I solved it like this:
LoadFormat oLoadFormat = CellsHelper.DetectLoadFormat(oStream);
Workbook oWorkbook = new Workbook(oExcelStream);
…
SaveFormat oSaveFormat = FileFormatUtil.LoadFormatToSaveFormat(oLoadFormat);
oWorkbook.Save(oOutStream, oSaveFormat);
sFileExt = FileFormatUtil.SaveFormatToExtension(oSaveFormat);
Works perfect
Hi,
Thanks for sharing your sample code.
It’s good to know that you were able to solve this issue…
Let us know if you face any other issue regarding Aspose.Cells, we will help you ASAP.