DeleteRow method adds blank row in BOM

Good day!

I am writing macro for deleting BOM header row:

BomTableAnnotation swBOMAnnotation = default(BomTableAnnotation);
swBOMAnnotation = (BomTableAnnotation)swView.InsertBomTable5(false, 0.2, 0.2, AnchorType, BomType, _Configuration, TableTemplate, false, NbrType, true, true);

TableAnnotation swTableAnnotation = default(TableAnnotation);
swTableAnnotation = (TableAnnotation)swBOMAnnotation;
bool status = swTableAnnotation.DeleteRow2(0, false);
int rowCount = swTableAnnotation.RowCount;

But deleting header causes inserting new blank row before the last row in BOM table.

How to delete header row and avoid getting blank row?

Thank you!