Excel File missing after save

Aug 16, 2013 at 6:56 AM
Hi all,

I try to create an excel file and save it to an assigned folder. After i done save my package(excel file), and i check at the path/folder that i store my file. I cant file my file there. The file seem like missing. Below is my code:
var fileName = i + ".xlsx";
                        var outputDir = @"\\server\TestFolder\";

                        // Create the file using the FileInfo object
                        var file = new FileInfo(outputDir + fileName);

                        // Create the package and make sure you wrap it in a using statement
                        using (var package = new ExcelPackage(file))
                        {
                            //Add sheet 1 into excel
                            ExcelWorksheet worksheet = package.Workbook.Worksheets.Add("Sheet1");

                            //create header
                            worksheet.Cells[1, 1].Value = "Date";
                            worksheet.Cells[1, 2].Value = "No. of Student";
                            worksheet.Cells[1, 3].Value = "No. of Room";

                            //see the format for all column
                            worksheet.Column(1).Width = 20;
                            worksheet.Column(2).AutoFit();
                            worksheet.Column(3).AutoFit();
                            // worksheet.Column (1).ToString ("dd-MM-yyyy hh:mm:ss");
                            //sheet.Cells[1, 4].EntireColumn.NumberFormat = "@";
                            worksheet.Column(1).Style.Numberformat.Format = "dd/MM/yyyy hh:mm:ss";

                            // worksheet.Column(1) =
                            package.Save();