Method TXlsWorkSheet.DeleteRows does not work

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
marius
Posts: 12
Joined: Sat Jan 14, 2012 11:19 pm

Method TXlsWorkSheet.DeleteRows does not work

Post by marius »

Hello Lars,

I stumbled on a other problem, the DeleteRows does not seem to work.

You can reuse the sample i send to you, just replace the (only) line in the TfrmMain.btnCopyClick with this.
XLS[0].InsertRows(10, 5);
XLS[0].InsertRows(10, 5);
XLS[0].DeleteRows(10, 5);
XLS[0].DeleteRows(10, 5);

Regards,
Marius
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Method TXlsWorkSheet.DeleteRows does not work

Post by larsa »

Hello

The second parameter of DeleteRows is not a number of rows, it's a row number.
The correct code for your sample is:

Code: Select all

XLS[0].InsertRows(10, 5);
XLS[0].InsertRows(10, 5);
XLS[0].DeleteRows(10, 14);
XLS[0].DeleteRows(10, 14);
Lars Arvidsson, Axolot Data
marius
Posts: 12
Joined: Sat Jan 14, 2012 11:19 pm

Re: Method TXlsWorkSheet.DeleteRows does not work

Post by marius »

Whoops, I automaticly assumed the same parameters, its not as consistent as i thought ;)

Sorry for the disturbance
Marius
Post Reply