This is the sample to create differenct sheets in same excel sheet try this Microsoft.Office.Interop.Excel.Application _excel; Microsoft.Office.Interop.Excel._Workbook _wrkBk; Microsoft.Office.Interop.Excel._Worksheet _excelSheet; Microsoft.Office.Interop.Excel.Range _oRng; //create an object og Excel Application. _excel = new Microsoft.Office.Interop.Excel.Application(); _excel.Visible = false; //Get a new workbook. _wrkBk = (Microsoft.Office.Interop.Excel._Workbook)(_excel.Workbooks.Add(Missing.Value)); _excelSheet = (Microsoft.Office.Interop.Excel._Worksheet)_wrkBk.ActiveSheet; Microsoft.Office.Interop.Excel._Worksheet _tempSheet = (Microsoft.Office.Interop.Excel.Worksheet)_wrkBk.Worksheets["Sheet1"]; int _defaultSheetCount = _wrkBk.Worksheets.Count; for (int j = 0; j < dt.Rows.Count; j++) { if ((j + 1) <= _defaultSheetCount) { _excelSheet = (Microsoft.Office.Interop.Excel.Worksheet)_wrkBk.Worksheets["Sheet" + (j + 1)]; } else { _excelSheet = (Microsoft.Office.Interop.Excel._Worksheet)_wrkBk.Sheets.Add(Type.Missing, _tempSheet, Type.Missing, Type.Missing); } _tempSheet = _excelSheet; //write the data in the predefined format to the Excel Sheet. _excelSheet.Cells[1, 3] = "test";
Thanks & Regards, NeW OnE, please don't forget to vote on the post