Hi Chandra,
Thanks for your posting and using Aspose.Cells.
You can use the Workbook(stream) constructor to open your file from memory stream. Suppose, you have your Excel file in the form of bytes, then you can create a memory stream object from your bytes and then create workbook object from memory stream.
Please see the following sample code. I have attached the source Excel file and the output PDF for your reference.
C#
byte[] filesData = File.ReadAllBytes(“source.xlsx”);
//Create memory stream object from your bytes
MemoryStream ms = new MemoryStream(filesData);
ms.Position = 0;
//Create workbook object from memory stream
Workbook workbook = new Workbook(ms);
//Save it in the PDF format
workbook.Save(“output.pdf”, SaveFormat.Pdf);
Hi,
Thanks for reply
I have created workbook using following code.
Workbook workbook = new Workbook();
workbook.Worksheets.Clear();
int i = workbook.Worksheets.Add();
Worksheet worksheet = workbook.Worksheets[i];
worksheet.Cells.ImportArray(ExportHelper.GetGridColumnHeaders(grid), 0, 0, false);
I want open the workbook without saving to Disk.
Hi,
Do you want to open the Workbook (Excel file) into MS Excel like grid interface visually on the fly? Well, Aspose.Cells is a library used to create, manipulate, render or print spreadsheets, it does not provide any UI or grid like environment, you would always need some sort of viewer or MS Excel to open/ view the generated file into it.
However, if you want grid like environment or control to view spreadsheets or Excel files, we also provide Aspose.Cells Grid Suite, the Aspose.Cells Grid Suite is composed of two controls:
Aspose.Cells.GridDesktop and Aspose.Cells.GridWeb. So, if you need to view or manipulate Excel files in WYSIWYG (visual) manner, Aspose.Cells for .NET also provides a suit of Grid like controls (independent controls i.e…, Aspose.Cells.GridDesktop and Aspose.Cells.GridWeb) that provides this capability to view/display, create and manipulate Excel files on the fly.
Please see the docs and demos of GridWeb for your reference:
Thank you.
I want to open as Excel spreadsheet.
Hi Chandra,
Thanks for using Aspose.Cells.
Do you want to open it in Microsoft Excel? Please see the following sample code, it opens the source.xlsx file in Microsoft Excel.
C#
string filePath = @“F:\Shak-Data-RW\Downloads\source.xlsx”;
System.Diagnostics.Process.Start(filePath);