XDoc.Excel
Features
Tech Specs
How-to C#
Pricing

C# Excel Library
C# Excel - Excel Creating in C#.NET


Tell Users How to Create New Excel File and Load Excel from Other Files





C#.NET Excel document file creating library control, RasterEdge XDoc.Excel SDK for .NET, is a robust & thread-safe .NET solution which provides a reliable and quick approach for C# developers to create a highly-secure and industry-standard Excel document file. The Excel document file created by RasterEdge C# Excel document creator library is searchable and can be fully populated with editable text and graphics programmatically.

This Visual C# .NET Excel document creation control toolkit can not only allow developers to generate standard Excel document file but also offer them the ability to count the page numbers of generated Excel document by simple C# programming code. As this Excel document creator library is built in .NET Framework 2.0 and designed specifically for .NET applications, C# developers can easily use this professional Excel document generating SDK in all .NET developing applications, including ASP.NET web services and Windows Forms application.

After creating a Excel document in C#.NET using this Excel document creating toolkit, if you need to add some text and draw some graphics on created Excel document file, you can also use this C#.NET Excel document drawing library control.


Create New Excel Document With One Blank Page in C# Project



In C# class programming, you can use specific APIs to create Excel file. And the Excel document can contain one empty page or multiple empty pages. The following example will tell you how to create a Excel document with one empty page.

String outputFile = Program.RootPath + "\\" + "output.xlsx";

//  Create a new Excel Document object with one blank page
XLSXDocument doc = XLSXDocument.Create(outputFile);

//  Save the new created Excel document into file
doc.Save(outputFile);


Extract Excel Document From Existing Excel File Using C#



You may also load or create a Excel document object from existing Excel file in C#.net.

//  Load from a file
String inputFilePath1 = Program.RootPath + "\\" + "1.xlsx";
XLSXDocument doc1 = new XLSXDocument(inputFilePath1);
if (doc1 == null) throw new Exception("fail to load the file");
//  ...


Load Excel From Stream Object in C# Project



Excel document can be loaded from a stream object in C# programming.

//  Load from a stream
String inputFilePath = Program.RootPath + "\\" + "2.xlsx";
using (FileStream fileStream = File.Open(inputFilePath, FileMode.Open, FileAccess.Read))
{
    XLSXDocument doc = new XLSXDocument(fileStream);
    if (doc == null) throw new Exception("fail to load Excel document from the stream");
    //  ...
}