i used EPPlus.dll as my library in creating Excel sheets.
But using these codes, i got an error: Exception thrown: 'System.NullReferenceException' in ExcelReports.cs:line 37
28. String filename = "D:\\" + MonthYear + "_journal.xls";
29. FileInfo template = new FileInfo("D:\\template_journal.xls");
30. if (File.Exists(filename))
31. {
32. File.Delete(filename);
33. }
34. FileInfo newFile = new FileInfo(filename);
35. ExcelPackage pck = new ExcelPackage(newFile, template);
36. ExcelWorksheet journalsheet = pck.Workbook.Worksheets["Journal"];
37. journalsheet.Cells["C1"].Value = "Sample Value";
38. pck.Save();