Date calculation issue
Posted: Mon Mar 16, 2015 10:31 am
Hello,
I have a simple Excel input file containing data in the A1 and B1 cells.
A1 has a date value: November 26th, 2014
and there's a formula in B1: =DATE(YEAR(A1);MONTH(A1)+3;DAY(A1))
Here is my code:
After executing this code, in B1 cell of the output file there is a value of Februar 26th, 2014 instead of Februar 26th, 2015.
Please investigate this error.
Thank you in advance.
I have a simple Excel input file containing data in the A1 and B1 cells.
A1 has a date value: November 26th, 2014
and there's a formula in B1: =DATE(YEAR(A1);MONTH(A1)+3;DAY(A1))
Here is my code:
Code: Select all
procedure TForm1.btn1Click(Sender: TObject);
var
XLS: TXLSReadWriteII5;
begin
XLS := TXLSReadWriteII5.Create(nil);
try
XLS.Filename := 'D:\input.xlsx';
XLS.Read;
XLS.Calculate;
XLS.Filename := 'D:\output.xlsx';
XLS.Version := xvExcel2007;
XLS.Write;
finally
FreeAndNil(XLS);
end;
end;
Please investigate this error.
Thank you in advance.