Free .NET Library for Creating Spreadsheet Documents

Read, Write, Manipulate & Convert Excel files via Open Source .NET API.

NetOffice API allows .NET developers to Read, Write, Manipulate & Convert Excel files via open source .NET API. The API allows automating Microsoft Excel Spreadsheets and develop Microsoft Excel Add-ins. Using the API, the developer will use all the options enclosed in MS Office versions 2000, 2002, 2003, 2007, 2010, 2013 and 2016. The API relies on COM-architecture where you retrieve COM proxy objects in your application.

In order to work with Microsoft Excel document, you need ExcelApi.dll with OfficeApi.ddl, VBIDEApi.dll, and NetOffice.dll as dependencies. All Office applications use types which are defined in other components/type libraries. These dependent type libraries are therefore given as an independent assembly. Each assembly also requires the NetOffice.dll assembly.

Previous Next

Getting Started with NetOffice

First of all, you require to have .NET Framework 4.5 or above. After that, please download the repository manually from GitHub or install it from NuGet.

Installation  NetOffice from NuGet

 Install-Package NetOfficeFw.Excel

Add Shapes in Excel using Free C# API

NetOffice allows .NET programmers to add shapes in Microsoft Excel Spreadsheets programmatically. In order to add shapes in excel file first you need to initialize an Excel.Application and turn off message boxes. After your excel application is started you can add a new document in it using ExcelApplication.Workbooks.Add() method. You can insert text in your newly created exce file using workSheet.Cells[1, 1].Value property and add shape in the file using WorkSheet.Shapes.AddShape(MsoAutoShapeType.msoShape32pointStar, 10, 50, 200, 20) method.

Installation  NetOffice from NuGet

 Install-Package NetOfficeFw.Excel

Create a Chart in Excel using C#

NetOffice allows .NET programmers to add charts in Microsoft Excel File programmatically. In order to add charts in excel file first you need to initialize an Excel.Application and turn off message boxes and add new worksheet using xcelApplication.Workbooks.Add() method. You can insert charts in your newly created excel file by initializing Excel.ChartObject and set it using ((Excel.ChartObjects)workSheet.ChartObjects()).Add(70, 100, 375, 225) method You can set the data source of your newly created chart using Chart.SetSourceData() method

Installation  NetOffice from NuGet

 Install-Package NetOfficeFw.Excel