MergedCells - remove merge

Questions and answers on how to use XLSSpreadSheet.
Post Reply
nagygabor679
Posts: 4
Joined: Wed Sep 07, 2022 8:07 am

MergedCells - remove merge

Post by nagygabor679 »

Hi,

I would like to merge cells and remove merge.
I wrote this little test program:

Code: Select all

procedure TForm1.btn1Click(Sender: TObject);
begin
  with xs do
  begin
    XLS[0].SelectedAreas[0].Col1 := 1;
    XLS[0].SelectedAreas[0].Row1 := 1;
    XLS[0].SelectedAreas[0].Col2 := 2;
    XLS[0].SelectedAreas[0].Row2 := 2;
    XLS[0].MergeCells;
    xs.InvalidateSheet;
  end;
end;

procedure TForm1.btn2Click(Sender: TObject);
begin
  xs.XLS[0].MergedCells.Delete(0);
  xs.InvalidateSheet;
end;
When I push btn1 button, then the cells are merged, when I push the btn2 then merge is removed. It's working fine, I can do it many times while I don't click anywhere in the spreadsheet.

If I push btn1 and push btn2 then I click in cell A1 (or anywhere) and I push again btn1 and btn2 I get an "Invalid pointer operation" message.
What's wrong ? Is it spreadsheet bug?

(Delphi 7 Pro + XLSSpreadSheet 3.00.14 )

Regrds,
Gábor
Post Reply