Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,8 @@ ExcelEngine excelEngine = new ExcelEngine();
//Initialize IApplication
IApplication application = excelEngine.Excel;

//Load the file into stream
FileStream inputStream = new FileStream("Sample.xlsx", FileMode.Open, FileAccess.Read);

//Loads or open an existing workbook through Open method of IWorkbooks
IWorkbook workbook = application.Workbooks.Open(inputStream);
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");

//To-Do some manipulation
//To-Do some manipulation
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
title: Loading and saving workbook in ASP.NET Core | Syncfusion
description: Explains how to load and save Excel files in ASP.NET Core applications using Syncfusion XlsIO.
description: Explains how to load and save Excel files in ASP.NET Core applications using Syncfusion Excel(XlsIO) library.
platform: document-processing
control: XlsIO
documentation: UG
---
# Loading and saving workbook in ASP.NET Core

## Opening an existing workbook from stream
## Opening an existing workbook

You can open an existing workbook from stream by using the overloads of [Open](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbooks.html#Syncfusion_XlsIO_IWorkbooks_Open_System_IO_Stream_) methods of [IWorkbooks](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbooks.html) interface.
You can open an existing workbook by using the overloads of [Open](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IWorkbooks.html#Syncfusion_XlsIO_IWorkbooks_Open_System_String_) methods of [IWorkbooks](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbooks.html) interface.

{% tabs %}
{% highlight c# tabtitle="C# [Cross-platform]" %}
Expand All @@ -19,17 +19,14 @@ ExcelEngine excelEngine = new ExcelEngine();
//Initialize IApplication
IApplication application = excelEngine.Excel;

//Load the file into stream
FileStream inputStream = new FileStream("Sample.xlsx", FileMode.Open, FileAccess.Read);

//Loads or open an existing workbook through Open method of IWorkbooks
IWorkbook workbook = application.Workbooks.Open(inputStream);
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
{% endhighlight %}
{% endtabs %}

## Saving an Excel workbook to stream
## Saving an Excel workbook

You can also save the created or manipulated workbook to stream using overloads of [SaveAs](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbook.html#Syncfusion_XlsIO_IWorkbook_SaveAs_System_IO_Stream_) methods.
You can also save the created or manipulated workbook using overloads of [SaveAs](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IWorkbook.html#Syncfusion_XlsIO_IWorkbook_SaveAs_System_String_) methods.

{% tabs %}
{% highlight c# tabtitle="C# [Cross-platform]" %}
Expand All @@ -39,20 +36,16 @@ ExcelEngine excelEngine = new ExcelEngine();
//Initialize IApplication
IApplication application = excelEngine.Excel;

//Load the file into stream
FileStream inputStream = new FileStream("Sample.xlsx", FileMode.Open, FileAccess.Read);

//Loads or open an existing workbook through Open method of IWorkbooks
IWorkbook workbook = application.Workbooks.Open(inputStream);
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");

//To-Do some manipulation
//To-Do some manipulation

//Set the version of the workbook
workbook.Version = ExcelVersion.Xlsx;

//Saving the workbook as stream
FileStream outputStream = new FileStream("Output.xlsx", FileMode.Create, FileAccess.ReadWrite);
workbook.SaveAs(outputStream);
//Saving the workbook
workbook.SaveAs("Output.xlsx");
{% endhighlight %}
{% endtabs %}
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ using (ExcelEngine excelEngine = new ExcelEngine())
application.DefaultVersion = ExcelVersion.Xlsx;

//Load an existing Excel document
FileStream inputStream = new FileStream("Data/InputTemplate.xlsx", FileMode.Open, FileAccess.Read);
IWorkbook workbook = application.Workbooks.Open(inputStream);
IWorkbook workbook = application.Workbooks.Open("Data/InputTemplate.xlsx");

//Access first worksheet from the workbook.
IWorksheet worksheet = workbook.Worksheets[0];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Loading and Saving Excel in Azure Functions v1 | Syncfusion
description: Explains how to load and save an Excel files in Azure Functions v1 using Syncfusion Excel library.
description: Explains how to load and save an Excel files in Azure Functions v1 using Syncfusion Excel(XlsIO) library.
platform: document-processing
control: XlsIO
documentation: UG
Expand Down Expand Up @@ -49,8 +49,7 @@ using (ExcelEngine excelEngine = new ExcelEngine())
application.DefaultVersion = ExcelVersion.Xlsx;

//Load an existing Excel document
FileStream inputStream = new FileStream("Data/InputTemplate.xlsx", FileMode.Open, FileAccess.Read);
IWorkbook workbook = application.Workbooks.Open(inputStream);
IWorkbook workbook = application.Workbooks.Open("Data/InputTemplate.xlsx");

//Access first worksheet from the workbook
IWorksheet worksheet = workbook.Worksheets[0];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Loading and Saving Excel in Azure Functions v4 | Syncfusion
description: Explains how to load and save an Excel files in Azure Functions v4 using Syncfusion Excel library.
description: Explains how to load and save an Excel files in Azure Functions v4 using Syncfusion Excel(XlsIO) library.
platform: document-processing
control: XlsIO
documentation: UG
Expand Down Expand Up @@ -49,8 +49,7 @@ using (ExcelEngine excelEngine = new ExcelEngine())
application.DefaultVersion = ExcelVersion.Xlsx;

//Load an existing Excel document
FileStream inputStream = new FileStream("Data/InputTemplate.xlsx", FileMode.Open, FileAccess.Read);
IWorkbook workbook = application.Workbooks.Open(inputStream);
IWorkbook workbook = application.Workbooks.Open("Data/InputTemplate.xlsx");

//Access first worksheet from the workbook
IWorksheet worksheet = workbook.Worksheets[0];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
title: Loading and saving workbook in Blazor | Syncfusion
description: Explains how to load and save Excel files in Blazor applications using Syncfusion XlsIO.
description: Explains how to load and save Excel files in Blazor applications using Syncfusion Excel(XlsIO) library.
platform: document-processing
control: XlsIO
documentation: UG
---
# Loading and saving workbook in Blazor

## Opening an existing workbook from Stream
## Opening an existing workbook

You can open an existing workbook from stream by using the overloads of [Open](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbooks.html#Syncfusion_XlsIO_IWorkbooks_Open_System_IO_Stream_) methods of [IWorkbooks](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbooks.html) interface.
You can open an existing workbook by using the overloads of [Open](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IWorkbooks.html#Syncfusion_XlsIO_IWorkbooks_Open_System_String_) methods of [IWorkbooks](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbooks.html) interface.

The code snippet for this process in Blazor Server-Side application is given below.

Expand All @@ -21,11 +21,8 @@ ExcelEngine excelEngine = new ExcelEngine();
//Initialize IApplication
IApplication application = excelEngine.Excel;

//Load the file into stream
FileStream inputStream = new FileStream("Sample.xlsx", FileMode.Open, FileAccess.Read);

//Loads or open an existing workbook through Open method of IWorkbooks
IWorkbook workbook = application.Workbooks.Open(inputStream);
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
{% endhighlight %}
{% endtabs %}

Expand Down Expand Up @@ -61,11 +58,8 @@ ExcelEngine excelEngine = new ExcelEngine();
//Initialize IApplication
IApplication application = excelEngine.Excel;

//Load the file into stream
FileStream inputStream = new FileStream("Sample.xlsx", FileMode.Open, FileAccess.Read);

//Loads or open an existing workbook through Open method of IWorkbooks
IWorkbook workbook = application.Workbooks.Open(inputStream);
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");

//To-Do some manipulation
//To-Do some manipulation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Loading and Saving Excel in GCP | Syncfusion
title: Loading and Saving Excel in Google App Engine | Syncfusion
description: Explains how to load and save an Excel files in Google App Engine using .NET Core Excel (XlsIO) library without Microsoft Excel or interop dependencies.
platform: document-processing
control: XlsIO
Expand Down Expand Up @@ -90,8 +90,7 @@ using (ExcelEngine excelEngine = new ExcelEngine())
application.DefaultVersion = ExcelVersion.Xlsx;

//Load an existing Excel document
FileStream inputStream = new FileStream("Data/InputTemplate.xlsx", FileMode.Open, FileAccess.Read);
IWorkbook workbook = application.Workbooks.Open(inputStream);
IWorkbook workbook = application.Workbooks.Open("Data/InputTemplate.xlsx");

//Access first worksheet from the workbook.
IWorksheet worksheet = workbook.Worksheets[0];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
title: Loading and saving workbook on Linux | Syncfusion
description: Explains how to load and save Excel files on Linux applications using Syncfusion XlsIO.
description: Explains how to load and save Excel files on Linux applications using Syncfusion Excel(XlsIO) library.
platform: document-processing
control: XlsIO
documentation: UG
---
# Loading and saving workbook on Linux

## Opening an existing workbook from stream
## Opening an existing workbook

You can open an existing workbook from stream by using the overloads of [Open](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbooks.html#Syncfusion_XlsIO_IWorkbooks_Open_System_IO_Stream_) methods of [IWorkbooks](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbooks.html) interface.
You can open an existing workbook by using the overloads of [Open](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IWorkbooks.html#Syncfusion_XlsIO_IWorkbooks_Open_System_String_) methods of [IWorkbooks](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbooks.html) interface.

{% tabs %}
{% highlight c# tabtitle="C# [Cross-platform]" %}
Expand All @@ -19,15 +19,14 @@ ExcelEngine excelEngine = new ExcelEngine();
//Initialize IApplication
IApplication application = excelEngine.Excel;

//A existing workbook is opened.
FileStream inputStream = new FileStream("Sample.xlsx", FileMode.Open, FileAccess.Read);
IWorkbook workbook = application.Workbooks.Open(inputStream);
//A existing workbook is opened.
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
{% endhighlight %}
{% endtabs %}

## Saving an Excel workbook to stream
## Saving an Excel workbook

You can also save the created or manipulated workbook to stream using overloads of [SaveAs](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbook.html#Syncfusion_XlsIO_IWorkbook_SaveAs_System_IO_Stream_) methods.
You can also save the created or manipulated workbook using overloads of [SaveAs](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IWorkbook.html#Syncfusion_XlsIO_IWorkbook_SaveAs_System_String_) methods.

{% tabs %}
{% highlight c# tabtitle="C# [Cross-platform]" %}
Expand All @@ -37,20 +36,16 @@ ExcelEngine excelEngine = new ExcelEngine();
//Initialize IApplication
IApplication application = excelEngine.Excel;

//A existing workbook is opened.
FileStream inputStream = new FileStream("Sample.xlsx", FileMode.Open, FileAccess.Read);
IWorkbook workbook = application.Workbooks.Open(inputStream);
//A existing workbook is opened.
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");

//To-Do some manipulation
//To-Do some manipulation

//Set the version of the workbook
workbook.Version = ExcelVersion.Xlsx;

//Initialize stream
FileStream outputStream = new FileStream("Output.xlsx", FileMode.Create);

//Save the workbook as stream
workbook.SaveAs(outputStream);
//Save the workbook
workbook.SaveAs("Output.xlsx");
{% endhighlight %}
{% endtabs %}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ documentation: UG
---
# Loading and saving workbook on Mac OS

## Opening an existing workbook from stream
## Opening an existing workbook

You can open an existing workbook from stream by using the overloads of [Open](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbooks.html#Syncfusion_XlsIO_IWorkbooks_Open_System_IO_Stream_) methods of [IWorkbooks](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbooks.html) interface.
You can open an existing workbook by using the overloads of [Open](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IWorkbooks.html#Syncfusion_XlsIO_IWorkbooks_Open_System_String_) methods of [IWorkbooks](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbooks.html) interface.

{% tabs %}
{% highlight c# tabtitle="C# [Cross-platform]" %}
Expand All @@ -19,18 +19,14 @@ ExcelEngine excelEngine = new ExcelEngine();
//Initialize IApplication
IApplication application = excelEngine.Excel;

//Load the file into stream
Assembly executingAssembly = typeof(Program).GetTypeInfo().Assembly;
Stream inputStream = executingAssembly.GetManifestResourceStream("XlsIOSample.Sample.xlsx");

//Loads or open an existing workbook through Open method of IWorkbooks
IWorkbook workbook = application.Workbooks.Open(inputStream);
IWorkbook workbook = application.Workbooks.Open("XlsIOSample/Sample.xlsx");
{% endhighlight %}
{% endtabs %}

## Saving an Excel workbook to stream
## Saving an Excel workbook

You can also save the created or manipulated workbook to stream using overloads of [SaveAs](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbook.html#Syncfusion_XlsIO_IWorkbook_SaveAs_System_IO_Stream_) methods.
You can also save the created or manipulated workbook using overloads of [SaveAs](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IWorkbook.html#Syncfusion_XlsIO_IWorkbook_SaveAs_System_String_) methods.

{% tabs %}
{% highlight c# tabtitle="C# [Cross-platform]" %}
Expand All @@ -40,22 +36,16 @@ ExcelEngine excelEngine = new ExcelEngine();
//Initialize IApplication
IApplication application = excelEngine.Excel;

//Load the file into stream
FileStream inputStream = new FileStream("Sample.xlsx", FileMode.Open, FileAccess.Read);

//Loads or open an existing workbook through Open method of IWorkbooks
IWorkbook workbook = application.Workbooks.Open(inputStream);
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");

//To-Do some manipulation
//To-Do some manipulation

//Set the version of the workbook
workbook.Version = ExcelVersion.Xlsx;

//Initialize stream
FileStream outputStream = new FileStream("Output.xlsx", FileMode.Create);

//Save the workbook as stream
workbook.SaveAs(outputStream);
workbook.SaveAs("Output.xlsx");
{% endhighlight %}
{% endtabs %}