Another issue when deleting rows: merged cells remain

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
bturcs
Posts: 23
Joined: Tue Nov 14, 2017 9:28 am

Another issue when deleting rows: merged cells remain

Post by bturcs »

Unfortunetaly I found another issue while deleting rows in an excel sheet. If I use merged cells and delete a range of rows (including the merged cells), they will not get deleted and remain in the document. The result is unsatisfactory because the remaing rows are affected.

Example screenshot:

Image

Here I deleted rows 0 to 4 (index). The merged cell isnt deleted and disturbs the remaining document.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Another issue when deleting rows: merged cells remain

Post by larsa »

Hello

This is fixed in update 6.00.26
Lars Arvidsson, Axolot Data
bturcs
Posts: 23
Joined: Tue Nov 14, 2017 9:28 am

Re: Another issue when deleting rows: merged cells remain

Post by bturcs »

While I can confirm that it works for:

Code: Select all

DeleteRows(0, 0, 4);
It does not work for:

Code: Select all

DeleteRows(0, 4, 4);
- thw row and formatting is deleted but the merged cell is moved to row 4.

Image

The merged cell remains, even if I delete row 5.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Another issue when deleting rows: merged cells remain

Post by larsa »

Hello

There is a new update for this now.
Lars Arvidsson, Axolot Data
bturcs
Posts: 23
Joined: Tue Nov 14, 2017 9:28 am

Re: Another issue when deleting rows: merged cells remain

Post by bturcs »

I installed the updated components and can confirm that it is working now.
bturcs
Posts: 23
Joined: Tue Nov 14, 2017 9:28 am

Re: Another issue when deleting rows: merged cells remain

Post by bturcs »

I'm sorry, but I discovered another problem with merged cells and deleted rows.

Following example:
Image

On the left side, you see the original file. Here, I delete rows from index 21 to index 28 (marked yellow). The result is in the middle: merged cells remain at row index 14 and merged cells are missing on row 23. On the right hand side is the result if I delete the rows manually in Excel. This worken in XLSSUIT4.

Code:

Code: Select all

  try
    LDoc := TXLSReadWriteII5.Create(nil);
    LDoc.Filename := LSource;
    LDoc.Read;

    LDoc.DeleteRows(0, 21, 28);

    LDoc.Filename := LTarget;
    LDoc.Write;
  finally
    freeAndNil(LDoc);
  end;
bturcs
Posts: 23
Joined: Tue Nov 14, 2017 9:28 am

Re: Another issue when deleting rows: merged cells remain

Post by bturcs »

Thank you for your bugfix. With the latest version 6.00.30, I can report that deleting rows works and nice XLS documents are created! :mrgreen:
Post Reply