Old wks.deleteRows(rowBegin[,numRows, colBegin, colEnd]) can only be used to delete specified range.
Improved it in Origin 2023b to add a new default wks.deleteRows(0) to delete current selected rows:
wks.deleteRows(); or wks.deleteRows(0); //delete without undo
wks.DeleteRows(0,1); //delete with undo