HOW TO CREATE A NEW WORKSHEET IN EXCEL FILE C#?

Jayden Bell

Total Post:110

Points:774
Posted by  Jayden Bell
C# 
C#
 1188  View(s)
Ratings:
Rate this:
I am developing a demo application and i need to create a new worksheet in Excel using C#.
Please help.
  1. Pravesh Singh

    Post:412

    Points:2888
    Re: How to create a new worksheet in Excel file c#?

    Hi Jayden,


    var xlSheets = xlWorkBook.Sheets as Excel.Sheets;

    var xlNewSheet = (Excel.Worksheet)xlSheets.Add(xlSheets[1], Type.Missing, Type.Missing, Type.Missing);

    xlNewSheet.Name = "newsheet";

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!