I using Spire.XLS 10.5.7.
I'm trying to get the date difference using the DATEDIF function.
If you specify "Y", "M", "D" in the argument UNIT, it works well.
However, if you specify "YM", the result will be #NUM.
Recalculating in MS Excel gives the correct results, but
We need to get this result in Spire.XLS.
- Code: Select all
using (var workbook = new Workbook())
{
workbook.LoadFromFile("src.xlsx");
var sheet = workbook.Worksheets[0];
sheet["_begin_date"].Value = "1920/01/01";
sheet["_end_date"].Value = "2048/05/12";
workbook.CalculateAllValue();
workbook.SaveToFile("out.xlsx");
}
Thank you and best regards,