Basically i am building Dynamic Excel using EPPlus 4.1.0. The problem am facing is when i download the excel and click open. Its throwing error as "Excel found unreadable content in .xlsx. Do you want to recover the contents of this workbook? If
you trust the source of this workbook,click Yes
I am using below steps to generate excel :
- Creating new Excel Package -- ExcelPackage ex = new ExcelPackage()
- Creating new worksheet -- ExcelWorksheet ws = ex.Workbook.Worksheets.Add("Demo");
- Working on that worksheet -- Content,alignment,coloring etc..
- Saving the response
5.On click of Download, ill get options to save open etc. When i select Open,it throws the above error.
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AddHeader("content-disposition", "attachment; filename=ExcelDemo.xlsx");
This error not happening in EPplus3. versions. But we need to use latest versions for building dynamic excel data with formatting in it.
Any way to resolve this issue would be of great help.