MoveCells with ccoLockStartRow option

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
huseyinxy
Posts: 13
Joined: Wed Oct 07, 2015 7:41 am

MoveCells with ccoLockStartRow option

Post by huseyinxy »

XLSReadWriteII 5, in MoveCells method option ccoLockStartRow is not working as expected.

Moving a cell from B3 to B15 with a formula something like that =SUM(B3:B3), new formula must be =SUM(B3, B15) with ccoLockStartRow option but formula changes to = SUM(B15:B15)

ccoLockStartRow option has no affect in MoveCells XLSReadWriteII 5
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: MoveCells with ccoLockStartRow option

Post by larsa »

Hello

True. ccoLockStartRow is not implemented. Will fix this in a later update.
Lars Arvidsson, Axolot Data
huseyinxy
Posts: 13
Joined: Wed Oct 07, 2015 7:41 am

Re: MoveCells with ccoLockStartRow option

Post by huseyinxy »

Hi, when the next update will be ready
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: MoveCells with ccoLockStartRow option

Post by larsa »

Hello

It will probably take a couple of weeks. We have a lot of do right now.
Lars Arvidsson, Axolot Data
huseyinxy
Posts: 13
Joined: Wed Oct 07, 2015 7:41 am

Re: MoveCells with ccoLockStartRow option

Post by huseyinxy »

Hello, is there any improvement in this subject, it's some urgent.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: MoveCells with ccoLockStartRow option

Post by larsa »

Hello

This is fixed in update 5.20.65
Lars Arvidsson, Axolot Data
huseyinxy
Posts: 13
Joined: Wed Oct 07, 2015 7:41 am

Re: MoveCells with ccoLockStartRow option

Post by huseyinxy »

Hello,

Thank you for the update. But unfortunately my problem still unsolved case.

In my debug sesssion notice that Workbook movecells method calls copycells with copyoptions and than it calls sheets copycells method with copyoptions but in this method ccoLockStartRow option still not implemented.

My sample xls file and code is below


with TXlsReadWriteII class sample code works properly

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
  fn1, fn2: string;
  Excel: TXlsReadWriteII;
begin
  fn1 := 'D:\Tests\Excel\MoveCell\temp1.xls';
  fn2 := 'D:\Tests\Excel\MoveCell\temp2.xls';

  Excel := TXLSReadWriteII.Create(nil);
  Excel.Filename := fn1;
  Excel.Read;

  //move row5 to row10
  Excel.MoveCells(0, 1, 5, 3, 5,
                          0, 1, 10,
                         True, True);

  Excel.Filename := fn2;
  Excel.Write;
  Excel.Free;
end;
sample xls file1 content
A B C
1 a1 b1 10
2 a2 b2 20
3 a3 b3 30
4 a4 b4 40
5 a5 b5 50
6 a6 Tot =SUM(C1:C5)


Same code with the new TXlsReadWriteII5 class is not worked as expected

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
  fn1, fn2: string;
  Excel: TXlsReadWriteII5;
begin
  fn1 := 'D:\Tests\Excel\MoveCell\temp1.xls';
  fn2 := 'D:\Tests\Excel\MoveCell\temp2.xls';

  Excel := TXLSReadWriteII5.Create(nil);
  Excel.Filename := fn1;
  Excel.Read;

  //move row5 to row10
  Excel.MoveCells(0, 1, 5, 3, 5,
                           0, 1, 10,
                           CopyAllCells + [ccoAdjustCells, ccoLockStartRow]);


  Excel.SaveToFile(fn2);
  Excel.Free;
end;

sample xls file2 content
A B C
1 a1 b1 10
2 a2 b2 20
3 a3 b3 30
4 a4 b4 40
5 a5 b5 50
6
7
8
9
10
11 Tot =SUM(C6:C10) // expected 11 Tot =SUM(C1:C10)
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: MoveCells with ccoLockStartRow option

Post by larsa »

Hello

Forgot to include the fix when moving cells between sheets. Fixed in update 5.20.66
Lars Arvidsson, Axolot Data
huseyinxy
Posts: 13
Joined: Wed Oct 07, 2015 7:41 am

Re: MoveCells with ccoLockStartRow option

Post by huseyinxy »

It works, thank you for update
Post Reply