How to find the last Excel line using the xlsx-populate library

  • one
    What is the "last line" in your understanding? - Kromster
  • one
    @Kromster, the author is referring to the line, after which there is nothing. In PHPExcel, this is called $objPHPExcel->setActiveSheetIndex(0)->getHighestRow(); . I did not find an analogue in the xlsx-populate package. TS, I think you need to search by line by line search - Total Pusher

1 answer 1

 const value=workbook.sheet("Sheet1").usedRange().value().length; 

usedRange () - pulls all values ​​from the sheet. Thus we find how many lines are already taken. Of course, this will be the last line if all the found lines are filled, so the answer is not complete