in reply to Error when reach end excel sheet limit

For writing to the Excel-sheet you have probably some code like

$sheet->Range("$column$line")->{'Value'} = $myValue;
In that case it would be easy to check if your variable $line is > 60.000 ... no need for counting

HTH, Rata