Hi,
Please see the following code, it illustrates how to save the workbook object into byte array.
C#
string filePath = @"F:\Shak-Data-RW\Downloads\source.xlsx";
Workbook workbook = new Workbook(filePath);
//Save the workbook in memory stream
MemoryStream ms = new MemoryStream();
workbook.Save(ms, SaveFormat.Xlsx);
//Read bytes from memory stream
byte[] bytes = new byte[ms.Length];
ms.Read(bytes, 0, bytes.Length);
Many Thanks and Kind Regards,
Shakeel Faiz
Support Developer
Aspose Sialkot Team
Contact UsAspose - The .NET and Java Component Publisher
Keep in touch! We're on
Twitter and
Facebook