News & Releases

Minimize
Nasosoft Components for .NET v5.4.0 Released - Friday, September 06, 2013

Nasosoft Component for .NET v5.4.0 has released with many improvements.

What's new

Nasosoft Excel for .NET   
  • Bug Fixes

 

 

Nasosoft Excel for .NET

   Minimize
Copy a Worksheet
 
Copy a Worksheet with Specified Name
Code Sample
[C#]
 
//Create a Workbook object
XlsWorkbook workbook = new XlsWorkbook("C:\book1.xls");
 
//copy the worksheet with specified sheet name
workbook.Worksheets.AddCopy("sheet1");
 
//Save the Excel file
workbook.Save("C:\book1.xls");
 
[VB.NET]
 
'Create a Workbook object
Dim workbook As XlsWorkbook = New XlsWorkbook("C:\book1.xls")
 
'Copy the worksheet with specified sheet name
workbook.Worksheets.AddCopy("sheet1")
 
'Save the Excel file
workbook.Save("C:\book1.xls")
 
Copy a Worksheet with Specified Index
Code Sample
[C#]
 
//Create a Workbook object
XlsWorkbook workbook = new XlsWorkbook("C:\book1.xls");
 
//copy the worksheet with specified sheet index.
workbook.Worksheets.AddCopy(0);
 
//Save the Excel file
workbook.Save("C:\book1.xls");
 
[VB.NET]
 
'Create a Workbook object
Dim workbook As XlsWorkbook = New XlsWorkbook("C:\book1.xls")
 
'Copy the worksheet with specified sheet index
workbook.Worksheets.AddCopy0)
 
'Save the Excel file
workbook.Save("C:\book1.xls")
 
Copy a Worksheet from other Workbook
Code Sample
[C#]
 
//Create a Workbook object
XlsWorkbook workbook = new XlsWorkbook("C:\book1.xls");
 
//Create a Workbook object
XlsWorkbook workbook2 = new XlsWorkbook("C:\book2.xls");
 
//copy the worksheet from the workbook2.
workbook.Worksheets.AddCopy(workboo2.Worksheets[0]);
 
//Save the Excel file
workbook.Save("C:\book1.xls");
 
[VB.NET]
 
'Create a Workbook object
Dim workbook As XlsWorkbook = New XlsWorkbook("C:\book1.xls")
 
'Create a Workbook object
Dim workbook2 As XlsWorkbook = New XlsWorkbook("C:\book1.xls")
 
'copy the worksheet from the workbook2.
workbook.Worksheets.AddCopy(workboo2.Worksheets[0])
 
'Save the Excel file
workbook.Save("C:\book1.xls")