C# – How to add an Excel Worksheet programmatically – Office XP / 2003
You need to add a COM reference in your project to the “Microsoft Excel 11.0 Object Library“ – or whatever version is appropriate. This code works for me: private void AddWorksheetToExcelWorkbook(string fullFilename,string worksheetName) { Microsoft.Office.Interop.Excel.Application xlApp = null; Workbook xlWorkbook = null; Sheets xlSheets = null; Worksheet xlNewSheet = null; try { xlApp = new … Read more