I make the windows form on which on a single button click performs like this
'
private void button1_Click(object sender, EventArgs e)
{
Excel.Application exapp=null;
Excel.Workbook exbook=null;
Excel.Worksheet exsheet = null;
object misvalue = System.Reflection.Missing.Value;
exapp = new Excel.Application();
exapp.SheetsInNewWorkbook = 1;
exbook = exapp.Workbooks.Add(misvalue);
exsheet = (Excel.Worksheet)exbook.Worksheets.get_Item(1);
exsheet.Cells[1, 1] = "First Name";
exsheet.Cells[1, 2] = "Last Name";
exsheet.Cells[1, 3] = "Address1";
exsheet.Cells[1, 4] = "Address2";
exsheet.Cells[1, 5] = "City";
exsheet.Cells[1, 6] = "PinCode";
exsheet.Cells[1, 7] = "Phone Number";
exsheet.Cells[2, 1] = textBox1.Text.ToString();
exsheet.Cells[2, 2] = textBox2.Text.ToString();
exsheet.Cells[2, 3] = textBox3.Text.ToString();
exsheet.Cells[2, 4] = textBox4.Text.ToString();
exsheet.Cells[2, 5] = textBox5.Text.ToString();
exsheet.Cells[2, 6] = textBox6.Text.ToString();
exsheet.Cells[2, 7] = textBox7.Text.ToString();
exbook.SaveAs("rep.xls", Excel.XlFileFormat.xlWorkbookNormal, misvalue, misvalue, misvalue, misvalue, Excel.XlSaveAsAccessMode.xlExclusive, misvalue, misvalue, misvalue, misvalue, misvalue);
exapp.Quit();
releaseObject(exapp);
releaseObject(exbook);
releaseObject(exsheet);
}'
but this thing imports data from windows in only one sheet
but i want to make a new sheet one each button click in excel
can anybody help me in it??????
Thanks in advance