We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Copy Excel worksheet to another workbook in C#, VB.NET

Platform: WinForms |
Control: XlsIO

Syncfusion Excel (XlsIO) library is a .NET Excel library used to create, read, and edit Excel documents. Also, converts Excel documents to PDF files. Using this library, you can copy Excel worksheet to another workbook or within the same workbook.

Steps to copy Excel worksheet to another workbook, programmatically:

Step 1: Create a new C# console application project.

Create a new C# console application

Step 2: Install the Syncfusion.XlsIO.WinForms NuGet package as reference to your .NET Framework application from NuGet.org.

Install NuGet package

Step 3: Include the following namespace in the Program.cs file.


using Syncfusion.XlsIO;



Imports Syncfusion.XlsIO


Step 4: Use the following code snippet to copy an Excel worksheet from the source workbook to the destination workbook.


using (ExcelEngine excelEngine = new ExcelEngine())
    //Instantiate the application object
    IApplication application = excelEngine.Excel;
    //Add source and destination workbooks
    IWorkbook sourceWorkbook = application.Workbooks.Open("Source.xlsx");
    IWorkbook destinationWorkbook = application.Workbooks.Open("Destination.xlsx");
    //Copy Excel worksheet from source workbook to the destination workbook
    //Save the file



Using excelEngine As ExcelEngine = New ExcelEngine()
    'Instantiate the application object
    Dim application As IApplication = excelEngine.Excel
    'Add source and destination workbooks
    Dim sourceWorkbook As IWorkbook = application.Workbooks.Open("Source.xlsx")
    Dim destinationWorkbook As IWorkbook = application.Workbooks.Open("Destination.xlsx")
    'Copy Excel worksheet from source workbook to the destination workbook
    'Save the file
End Using


A complete Windows Forms working example of how to copy Excel worksheet to another workbook in C# and VB can be downloaded from Copy Excel worksheet to another workbook.zip.

AddCopy() method adds a copy of the specified worksheet or worksheets to the worksheet collection. ExcelWorksheetCopyFlags enumeration can be used to specify options when copying worksheets. AddCopy() method has six overloads whose API references are as follows:

  1. AddCopy(Int32)
  2. AddCopy(Int32,ExcelWorksheetCopyFlags)
  3. AddCopy(IWorksheet)
  4. AddCopy(IWorksheet,ExcelWorksheetCopyFlags)
  5. AddCopy(IWorksheets)
  6. AddCopy(IWorksheets,ExcelWorksheetCopyFlags)

Refer here to explore the rich set of Syncfusion Excel (XlsIO) library features.

See Also:

How to copy and insert a chart in the same worksheet using C#,VB.NET?

How to Copy a Range from One Workbook to Another Workbook?

How to copy and paste evaluated values from one range to another using XlsIO?

How to copy a cell value instead of formula in Spreadsheet?

How to merge the exported worksheet in an existing workbook?

Feature comparison of Interop and XlsIO


Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, include a license key in your projects. Refer the link to learn about generating and registering Syncfusion license key in your application to use the components without trail message.

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment
Mahesh Parchure
Feb 16, 2018

There is an issue with this, if source sheet having Header with Fond Size more than10 then that header or row not displayed in target file.

Can you please tell me solution on this issue, how do I get header in target file. 

And one more thing in source sheet, Header position not fixed it may be in 1st row or 2nd row or 3rd Row, 4th Row ..... and so on.. 

So how to get that header in target sheet ?

Mahesh Parchure
Feb 20, 2018

Hi, I again modified my question

If my rdl having one text box with value "Hello" and if I place one formula in that textbox along with Hello then it is displayed like that "Hello <<Expr>>

Suppose formula return value "World", Now if I ran report it displayed me Hello World, if I export to Excel it is still displayed Hello World.

But when I used SyncFusion to copy that excel sheet in some other workbook it displayed me blank row instead of "Hello World" !

Can you please help me how to access that type of cell using syncfusion ?

Abirami Varadharajan [Syncfusion]
Feb 22, 2018

Hi Mahesh,


We are unable to reproduce the issue. We have prepared sample with both the mentioned scenario and shared for your reference which can be downloaded from the following link.


Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/XlsIO_Sample2142392259.zip


If you are using older version of Syncfusion, it is recommended to upgraded to latest version with more bugs fixes, enhancements and features which is available for download under following link.


Download link: https://www.syncfusion.com/forums/136049/essential-studio-2018-volume-1-release-v16-1-0-24-is-available-for-download


If you face any issues even after upgrading to latest version, please contact our support team at support@syncfusion.com  to get a prompt assistance on this.




Mahesh Parchure
Feb 22, 2018

Thanks for your mail Abirami,

But now issue is when I open my excel file (which is downloaded from rdl) and just save as that file and use that new file then everything is fine.

But if I used downloaded file (without save as) then I lost my header.

I think this is because in my rdl I have header text box which displayed header and long with that(in same textbox) I add formula beside header. (I want to display some value along with my header).

It is find when download excel from rdl but as soon as I use syncfusion to copy that sheet in other workbook then in destination workbbok I lost my header !

And if I ave as that file manually and use that new file then it works using same syncfusion code ! That's something strage for me.

But anyway I try to use new version and let's see (currently I am using 13.1400.0.21)

Thank You

Mahesh Parchure


Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile