Severe Bug in XLSReadWriteII4
Posted: Sun Jun 01, 2008 9:50 am
Hello,
I open an Excel-File with 2189 lines in PaintCellSample. Then I write it,
after write it contains 4237 lines. I check the line number before and after write with:
CheckRows1 := XLS.Sheets[0].LastRow;
In Excel these added lines do not exist or are empty.
Here you can see a screen shot
https://winserion.org/BugReports/Write_Error.png
Please change https to h t t p to see the image.
I cannot understand, why h t t p may not be written here!!!!!!!!!!!!
To make the Excel2007 in compatibility mode file not write protected after save, I use the proposed code, see below.
I changed only this procedure from the example:
procedure TfrmMain.Button2Click(Sender: TObject);
var
i: integer;
checkRows1 : Cardinal;
checkRows2 : Cardinal;
begin
XLS.Filename := edFilename.Text;
XLS.Read;
TabSet.Tabs.Clear;
for i := 0 to XLS.Sheets.Count - 1 do
TabSet.Tabs.Add(XLS.Sheets.Name);
TabSet.TabIndex := 0;
Grid.Invalidate;
for i := 0 to XLS.Sheets.Count - 1 do
begin
XLS.Sheets.SheetProtection:=[spEditObjects,spEditScenarios,
spEditCellFormatting,spEditColumnFormatting,spEditRowFormatting,
spInsertColumns,spInsertRows,spInsertHyperlinks,spDeleteColumns,
spDeleteRows,spSelectLockedCells,spSortCellRange,spEditAutoFileters,
spEditPivotTables,spSelectUnlockedCells];
end;
CheckRows1 := XLS.Sheets[0].LastRow;
XLS.Write;
CheckRows2 := XLS.Sheets[0].LastRow;
Dialogs.ShowMessage(SysUtils.FloatToStr(checkRows1)+' lines, after write '+SysUtils.FloatToStr(checkRows2)+' lines');
end;
I hope that Larsa will answer this.
I now returned to XLSReadWriteII3 and everything is fine.
Peter
I open an Excel-File with 2189 lines in PaintCellSample. Then I write it,
after write it contains 4237 lines. I check the line number before and after write with:
CheckRows1 := XLS.Sheets[0].LastRow;
In Excel these added lines do not exist or are empty.
Here you can see a screen shot
https://winserion.org/BugReports/Write_Error.png
Please change https to h t t p to see the image.
I cannot understand, why h t t p may not be written here!!!!!!!!!!!!
To make the Excel2007 in compatibility mode file not write protected after save, I use the proposed code, see below.
I changed only this procedure from the example:
procedure TfrmMain.Button2Click(Sender: TObject);
var
i: integer;
checkRows1 : Cardinal;
checkRows2 : Cardinal;
begin
XLS.Filename := edFilename.Text;
XLS.Read;
TabSet.Tabs.Clear;
for i := 0 to XLS.Sheets.Count - 1 do
TabSet.Tabs.Add(XLS.Sheets.Name);
TabSet.TabIndex := 0;
Grid.Invalidate;
for i := 0 to XLS.Sheets.Count - 1 do
begin
XLS.Sheets.SheetProtection:=[spEditObjects,spEditScenarios,
spEditCellFormatting,spEditColumnFormatting,spEditRowFormatting,
spInsertColumns,spInsertRows,spInsertHyperlinks,spDeleteColumns,
spDeleteRows,spSelectLockedCells,spSortCellRange,spEditAutoFileters,
spEditPivotTables,spSelectUnlockedCells];
end;
CheckRows1 := XLS.Sheets[0].LastRow;
XLS.Write;
CheckRows2 := XLS.Sheets[0].LastRow;
Dialogs.ShowMessage(SysUtils.FloatToStr(checkRows1)+' lines, after write '+SysUtils.FloatToStr(checkRows2)+' lines');
end;
I hope that Larsa will answer this.
I now returned to XLSReadWriteII3 and everything is fine.
Peter