Excel buffer don´t read last row?

beckindenmarkbeckindenmark Member Posts: 33
Hi Guys

I have created a form withs read a little from a excel sheet, but why do I not get the last row?
I did tryed almost everything..... but last row in sheet is not in the Rec table. Anyone who can figure out why it dos not work proper.

Here is my code:

ExcelBuffer.OpenBook(FileName,SheetName);
ExcelBuffer.ReadSheet();
LineNo := 10000;

Headlines := tHeadlines + 1 ;
ExcelBuffer.SETFILTER(ExcelBuffer."Row No.",'>%1',tHeadlines);

IF ExcelBuffer.FINDSET() THEN BEGIN
xExcelBuffer := ExcelBuffer;
REPEAT

IF xExcelBuffer."Row No." <> ExcelBuffer."Row No." THEN BEGIN
"No." := LineNo;
Rec.INSERT;
CLEAR(Rec);
LineNo += 10000;

END;

Comments

  • BeliasBelias Member Posts: 2,998
    there is a "repeat" without an "until" in your code...can you post the whole code please?
    (I bet it is until excelbuffer.next = 0, but who knows?)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.