Posted on: 3/25/2014 5:26:02 AM | Views : 392

Hello All,
I am trying to create a excel file.But now i have to update the excel file if already exists.Please tell me how to check if the file already exists or not.i am using EPPlus dll.
private void GenerateXLSXFile(DataTable tbl) { dynamic excelPackage = new ExcelPackage(); dynamic excelWorksheet = excelPackage.Workbook.Worksheets.Add("DemoPage"); excelWorksheet.Cells["A1"].LoadFromDataTable(tbl, true); Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; Response.AddHeader("content-disposition", "attachment; filename=ExcelDemo.xlsx"); MemoryStream stream = new MemoryStream(excelPackage.GetAsByteArray()); Response.OutputStream.Write(stream.ToArray(), 0, stream.ToArray().Length); Response.Flush(); ...

Go to the complete details ...