Sto creando un file Excel utilizzando la libreria EPPlus. Quando creo il file e apro il file, viene visualizzato il seguente messaggio:Finestra di dialogo di errore visualizzata all'apertura di un file Excel generato con EPPlus
Abbiamo riscontrato un problema con alcuni contenuti in "ExcelDemo.xlsx". Vuoi che cerchiamo di recuperare il più possibile? Se si considera attendibile l'origine di questa cartella di lavoro, fare clic su Sì
Sto usando seguente codice
using (ExcelPackage pck = new ExcelPackage())
{
//Create the worksheet
ExcelWorksheet ws = pck.Workbook.Worksheets.Add("Demo");
//Load the datatable into the sheet, starting from cell A1. Print the column names on row 1
ws.Cells[1, 2].Value = "Excel Download";
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AddHeader("content-disposition", "attachment; filename=ExcelDemo.xlsx");
Response.BinaryWrite(pck.GetAsByteArray());
}
C'è problema nel mio codice o si tratta di un problema di Excel?
Ho trovato [questo forum] (https://social.technet.microsoft.com/Forums/office/en-US/f217048b-aa7c-4b6e-a346-59e0445543f6/we-found-a-problem-with- some-content-in-filenamexlsxdo-vuoi-us-to-try-to-recover-as-much-as-forum = excel) che suggerisce che puoi usare solo la proprietà 'Cell.Value' per i numeri che causano il problema che vedi. – chancea