C#: Online Guide
How To: excel SDK
Page: Insert Excel Pages
Page: Insert Excel Pages
  |  
Home ›› XDoc.Excel ›› C# Excel: Insert Excel Pages

C# Excel - Insert Blank Excel Page in C#.NET


Guide C# Users to Insert (Empty) Excel Page or Pages from a Supported File Format




Overview



C#.NET Excel document editor library control, RasterEdge XDoc.Excel, offers easy & mature APIs for developers to add & insert an (empty) page into an existing Excel document file. Besides, this Excel document page inserting library control toolkit allows developers to specify where they want to insert (blank) Excel document page (before the first page or after the last page or after any desired page of current Excel document) using C# .NET class code.


Related .net document control helps:
c# asp.net powerpoint document viewer: ASP.NET PowerPoint Document Viewer Control: view pptx files online in C# using ASP.NET
asp.net document viewer in c#: EdgeDoc ASP.NET Document Viewer C# Control: Open, view, annotate, redact, convert documents online using ASP.NET Web Con...
c# asp.net image viewer: ASP.NET Image Document Viewer Control: view, annotate, redact, convert image files in html web browser
asp.net annotate pdf using c#: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
c# asp.net tiff document viewer: ASP.NET Tiff Document Viewer: view, annotate Tiff files in HTML using C# Control
asp.net doc document viewer: ASP.NET Office Word Document Viewer: view MS Office Word files online using C# in ASP.NET web applications
asp.net edit pdf page using c#: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#


This C# .NET Excel document page inserting & adding component from RasterEdge is written in managed C# code and designed particularly for .NET class applications. Thus, using this Excel document page manipulating and processing control SDK, you can create & add new Excel page(s) to current target Excel document in both web server-side application and Windows Forms project using a few lines of simple C# code.


Apart from the ability to inserting a new Excel page into existing Excel document file, RasterEdge C# .NET Excel document page processing and editing control toolkit also owns other advanced Excel document page manipulating functions. RasterEdge offers detailed guidances for each of those page processing functions, such as how to merge Excel document files by C# code, how to rotate Excel document page, how to delete Excel page using C# .NET, how to reorganize Excel document pages and how to split Excel document in C# .NET class application.


By using reliable APIs, C# programmers are capable of adding and inserting (empty) Excel page or pages from various file formats, such as Excel, Tiff, Excel, Excel, PowerPoint, Bmp, Jpeg, Png, Gif, and so on. Some C# demos are provided for your reference.




C# DLLs: Add Page to Excel File



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;




Add and Insert a blank Page to Excel File in C#



This C# demo will help you to insert a Excel page to a DOCXDocument object at specified position.




String inputFilePath1 = Program.RootPath + "\\" + "1.xlsx";
String outPutFilePath = Program.RootPath + "\\" + "Output.xlsx";

XLSXDocument doc1 = new XLSXDocument(inputFilePath1);
// Specify a position for inserting the selected page.
int pageIndex = 2;

// Insert the page to the XLSXDocument at specified position.
doc1.AddEmptyPage( pageIndex);

// Output the new document.
doc1.Save(outPutFilePath);





Add and Insert Multiple Excel Pages to Excel Document Using C#



Moreover, you may use the following C# demo code to insert multiple pages of a Excel file to a XLSXDocument object at user-defined position.




String inputFilePath1 = Program.RootPath + "\\" + "1.xlsx";
String outPutFilePath = Program.RootPath + "\\" + "Output.xlsx";

XLSXDocument doc1 = new XLSXDocument(inputFilePath1);
// Specify a position for inserting the selected pages.
int pageIndex = 1;

// Insert the pages to the second document at specified position.
doc2.InsertPages(pages, pageIndex);

// Output the new document.
doc2.Save(outPutFilePath);