Lastrow - xlsrw4 vs xlsrw2

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
FANG
Posts: 3
Joined: Sat Oct 01, 2005 8:02 pm

Lastrow - xlsrw4 vs xlsrw2

Post by FANG »

Hi there

I have a largish spreadsheet - 24,000 rows and ssemed to be getting wierd results - like 10,000 blank rows.

so...

I tried the paintcell example using xlsrw2 with the fllowing code:

xls.Filename := edFilename.Text;
showmessage(inttostr(xls.sheets[TabSet.TabIndex].LastRow));
xls.Read;
TabSet.Tabs.Clear;
for i := 0 to xls.Sheets.Count - 1 do
TabSet.Tabs.Add(xls.Sheets[i].Name);
TabSet.TabIndex := 0;

xls.sheets[TabSet.TabIndex].CalcDimensionsex;
showmessage(inttostr(xls.sheets[TabSet.TabIndex].LastRow));

Grid.RowCount := xls.sheets[TabSet.TabIndex].LastRow + 2 ;
Grid.Invalidate;

all works fine.

Tried it with the xlswr4 version and its about 10,000 out.

Help!
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Lastrow - xlsrw4 vs xlsrw2

Post by larsa »

Hello

CalcDimensionsEx don't count blank cells while CalcDimensions does.
Lars Arvidsson, Axolot Data
FANG
Posts: 3
Joined: Sat Oct 01, 2005 8:02 pm

Re: Lastrow - xlsrw4 vs xlsrw2

Post by FANG »

Hi Larsa

I tried this with both calcdimensions and caldimensionsex but copied the last attempt above - silly me

XLSRW2 v2 and v3 both work fine, XLSWR4 doesn't.

I will send you the spreadsheet separately - you try!

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

Re: Lastrow - xlsrw4 vs xlsrw2

Post by larsa »

Hello

I can't reproduce this problem.
Lars Arvidsson, Axolot Data
Post Reply