I have a model in excel and trying to feed inputs through ASP.NET to the excel and returning the back the model results over the grid in the front end. I'm using EPPlus package in ASP.NET as it doesn't need MS Office to be installed.
I have trouble getting the value of the cell where NPV [Net Present Value] and IRR [Internal rate of return] functions have been used. It always returns #VALUE
or #NAME
. As a workaround, I was able to calculate NPV manually but I'm having a tough time with IRR.
Is there a way in EPPlus to paste all the cells as values in the worksheet? Or is there any other alternative?
Please help and thanks in advance
Update : I have EPPlus 4.5.3.1 and Visual studio 2013.
string strfilepath = Server.MapPath(destPath);
FileInfo fileInfo = new FileInfo(strfilepath);
ExcelPackage p = new ExcelPackage(fileInfo);
ExcelWorksheet myWorksheet = p.Workbook.Worksheets["Financial"];
GridView1.Rows[0].Cells[2].Text = float.Parse(myWorksheet1.Cells["f57"].Value.ToString()).ToString("N2");