Hello,
I have a problem with deleting a row in this function below. rows1 and rows2 after the deletion give always the same value. So the deletion of a row is
not reflected by XLSData.Sheets[0].LastRow;
How can it be updated?
I am using the last version of XLSReadWriteII together with Delphi XE2.
Sincerely Peter
function TXLSForm.DeleteRowFromExcel(Row: cardinal): boolean;
var
rows1, rows2: cardinal;
begin
rows1 := XLSData.Sheets[0].LastRow;
XLSData.DeleteRows(0, Row, Row);
rows2 := XLSData.Sheets[0].LastRow;
if (rows2 = rows1 - 1) then
begin
DeleteRowFromExcel := True;
end
else
begin
DeleteRowFromExcel := False;
end;
Problem with DeleteRows
Re: Problem with DeleteRows
Hello
LastRow is only uppdated after you call CalcDimensions. The reason for this is that it takes some time to call CalcDimensions.
LastRow is only uppdated after you call CalcDimensions. The reason for this is that it takes some time to call CalcDimensions.
Lars Arvidsson, Axolot Data