Page 1 of 1

Lastrow - xlsrw4 vs xlsrw2

Posted: Mon Dec 29, 2008 4:32 pm
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!

Re: Lastrow - xlsrw4 vs xlsrw2

Posted: Fri Jan 02, 2009 8:47 am
by larsa
Hello

CalcDimensionsEx don't count blank cells while CalcDimensions does.

Re: Lastrow - xlsrw4 vs xlsrw2

Posted: Fri Jan 02, 2009 12:35 pm
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

Re: Lastrow - xlsrw4 vs xlsrw2

Posted: Fri Jan 09, 2009 8:39 am
by larsa
Hello

I can't reproduce this problem.