Create, View, Edit, and Save Your Excel Files Using WPF Spreadsheet
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (168).NET Core  (29).NET MAUI  (154)Angular  (95)ASP.NET  (51)ASP.NET Core  (81)ASP.NET MVC  (89)Azure  (40)Blazor  (186)BoldSign  (11)DocIO  (24)Essential JS 2  (101)Essential Studio  (194)File Formats  (51)Flutter  (127)JavaScript  (214)Microsoft  (118)PDF  (77)Python  (1)React  (87)Streamlit  (1)Succinctly series  (130)Syncfusion  (761)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (46)Windows Forms  (59)WinUI  (64)WPF  (147)Xamarin  (160)XlsIO  (29)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (135)Chart  (93)Cloud  (14)Company  (445)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (61)Development  (536)Doc  (7)DockingManager  (1)eBook  (98)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (30)Extensions  (21)File Manager  (6)Gantt  (17)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (426)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (36)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (11)Scheduler  (48)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (29)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (110)UI  (294)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (26)Visual Studio Code  (17)Web  (492)What's new  (276)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Create, View, Edit and Save Your Excel Files Using WPF Spreadsheet

Create, View, Edit, and Save Your Excel Files Using WPF Spreadsheet

Spreadsheets are the heart of data analysis and storage. Almost everyone uses spreadsheets at some point, for personal use or for business.

Our Syncfusion WPF Spreadsheet is an Excel-inspired control that allows you to create, view, edit, and format Microsoft Excel files without having Microsoft Excel installed. It provides an integrated ribbon to cover any possible business scenario. In addition, this control supports a built-in calculation engine with more than 400 widely used formulas. It was built with the .NET Excel Library (Essential XlsIO), which features a full-fledged object model similar to the Microsoft Office automation libraries.

In this blog, I will explain how to create, read, and edit an Excel file using our Syncfusion WPF Spreadsheet control.

Note: If you are new to our Spreadsheet control, then please read the Getting Started with WPF Spreadsheet documentation before proceeding.

Create a simple Spreadsheet project

The following steps illustrate how to create a simple Spreadsheet project in WPF:

  1. First, open Visual Studio and select Create a New Project.
  2. Then, the New Project dialog will open. Choose WPF Application from the dropdown list and provide a name for your application. Refer to the following screenshot.

    Create a New WPF Project
    Create a New WPF Project
  3. Now, install the Syncfusion.SfSpreadsheet.WPF NuGet package as a reference to your .NET Framework app from
    Install the Syncfusion.SfSpreadsheet.WPF NuGet Package
    Install the Syncfusion.SfSpreadsheet.WPF NuGet Package

    The spreadsheet is available in the namespace Syncfusion.UI.Xaml.Spreadsheet and you can create it programmatically either by using the XAML or C# code.

  1. Next, add the SpreadsheetRibbon and bind the Spreadsheet as the DataContext to the SpreadsheetRibbon to make an interaction between the ribbon items and Spreadsheet.
  1. To add the SpreadsheetRibbon to your application, use the RibbonWindow since the backstage of the ribbon will open only when the ribbon is loaded under the RibbonWindow.
    Refer to the following code.

    <syncfusion:RibbonWindow x:Class="SpreadsheetDemo.MainWindow"
    xmlns:mc=" compatibility/2006"
    <syncfusion:SfSpreadsheetRibbon DataContext= "{Binding ElementName=spreadsheet}"  />
    <syncfusion:SfSpreadsheet x:Name="spreadsheet"/>
    </ syncfusion:RibbonWindow >

Now, we have created a simple WPF Spreadsheet project.

Create a new Excel workbook

You can create a new workbook by using the Create method. By default, a workbook will be created with a single worksheet. Use the following code to load the Spreadsheet workbook with a specified number of worksheets.


Also, you can add new worksheets on-demand in the WPF Spreadsheet control by clicking the AddNew button. Refer to the following screenshot.

Creating an Excel Workbook Using WPF Spreadsheet
Creating an Excel Workbook Using WPF Spreadsheet

View the existing Excel sheet

The following code snippet illustrates how to view Excel files using the WPF Spreadsheet control.

/// View the Excel file.
spreadsheetControl.Open (@"..\..\Data\GettingStarted.xlsx");
ExcelEngine excelEngine = new ExcelEngine();
IWorkbook workbook = excelEngine.Excel.Workbooks.Open(@"..\..\Data\GettingStarted.xlsx");
using (FileStream fileStream = new FileStream(@"..\..\Data\ GettingStarted.xlsx”, FileMode.Open))

Also, you can open the existing Excel files by clicking Open in the SpreadsheetRibbon backstage, like in the following screenshot.

Opening an Existing Excel File Using WPF Spreadsheet
Opening an Existing Excel File Using WPF Spreadsheet

Edit the values in an Excel file

The Spreadsheet provides support for editing, so you can modify and commit the cell values in a workbook. The following code snippet illustrates how to edit data in an Excel file using the WPF Spreadsheet control.

/// Editing a specific cell value.
var range = spreadsheetControl.ActiveSheet.Range[2,2];
spreadsheetControl.ActiveGrid.SetCellValue(range, "Syncfusion");

Refer to the following screenshot.

Editing the Cell Values in an Excel File Using WPF Spreadsheet
Editing the Cell Values in an Excel File Using WPF Spreadsheet

Saving an Excel sheet

You can save Excel workbooks using the Save() method. If the workbook already exists in the system drive, then it will be saved in the same location. Otherwise, the Save dialog box will open to let you save the workbook in a specified location.

Refer to the following code snippet.

/// Save the changes made in the file. If the file is not created yet, then it prompts to enter the filename to save.

/// Save the changes made in the file using the SaveFileDialog.

Also, you can save the Excel files using Save or SaveAs in the ribbon backstage.

Saving an Excel File Using WPF Spreadsheet
Saving an Excel File Using WPF Spreadsheet

GitHub reference

You can download the complete sample from Create, View, Edit, and Save Excel Files Using WPF Spreadsheet demo.


Thanks for reading! In this blog post, we gave a quick overview of how to create, view, edit, and save  Excel files using the Syncfusion WPF Spreadsheet control. This control also supports hyperlinks, bookmarks, encryption, localization, cell formatting, and more. Try out these versatile features and share your feedback in the comments section of this blog post!

The Spreadsheet control is also available in our ASP.NET (Core, MVC, Web Forms), JavaScript, Angular, React, Vue, UWP, WinForms, and WPF platforms.

If you are an existing Syncfusion user, please download the latest version from the License and Downloads page and try the new features for yourself. Also, our NuGet packages are available on

If you aren’t a customer yet, you can try our 30-day free trial to check out these features. Also, try our other demos from this GitHub repository.

You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Related blogs


Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed
Scroll To Top