Deleting last row of BOM using API

I have a BOM and want to delete the last row (row number 3) using the SW API, I have tried to record a macro to do this and got the following:

boolstatus = Part.Extension.SelectByID2("DetailItem12@1", "ANNOTATIONTABLES", -7.31662186382903E-04, 0.184270796061969, 0, False, 0, Nothing, 0)

Part.EditDelete

It selects and deletes the entire BOM and not the row which was selected during recording.

SolidworksApi macros