C#: Online Guide
How To: excel SDK
File: Create, Load a Excel File
File: Create, Load a Excel File
  |  
Home ›› XDoc.Excel ›› C# Excel: Create, Load a Excel File

C# Excel - Excel Creating in C#.NET


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




Overview



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. vb.net pdf viewer, c# convert pdf to jpg, remove pdf password c#, c# extract images from pdf, c# create pdf from image, c# pdf417 generator. 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.


Related .net document control helps:
asp.net edit pdf text control: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
asp.net pdf viewer control free: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
asp.net sharepoint document viewer control: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
asp.net view excel in browser: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.
asp.net mvc image viewer: ASP.NET Image Viewer Control(MVC & WebForms): view, annotate, redact, convert image files in html, JQuery
asp.net dicom library: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
mvc document viewer: ASP.NET MVC Document Viewer: view, annotate, redact files on ASP.NET MVC web projects


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. convert pdf to bitmap c# open source, pdf metadata c#, vb.net convert pdf to text, c# remove text from pdf, c# get pdf font, convert pdf to html c# without library, c# generate pdf from html template. 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. pdf editor in asp.net mvc, how to add header and footer in pdf using itextsharp in asp.net, imagedraw asp.net multipage tiff viewer, asp.net show image from byte array, c# asp.net pdf viewer, asp.net core pdf preview, c# mvc website pdf file in stored in byte array display in browser.




C# DLLs: Create Excel Document



Add necessary references:


  RasterEdge.Imaging.Basic.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XDoc.Office.Inner.Office03.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.XDoc.Excel.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XImage.Raster.dll


Using namespaces:


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.Excel;




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");
    //  ...
}