VBA - Delete BOM Macro - Question

I use a simple macro i found here in the forum. https://forum.solidworks.com/message/706196#comment-706196 from . I have a Drawing with 7 different BOMS in the tree, i needed them to all be deleted.  I believed this used to work, but for some reason it is only deleting one BOM now.  From what i know it should continue till the swFeat = nothing, aka end of the feature tree.

Sub Main()

    Dim swApp           As SldWorks.SldWorks

    Dim swModel         As SldWorks.ModelDoc2

    Dim swFeat          As SldWorks.Feature

    Set swApp = Application.SldWorks

    Set swModel = swApp.ActiveDoc

    Set swFeat = swModel.FirstFeature

   

    While Not swFeat Is Nothing

   

        If "BomFeat" = swFeat.GetTypeName Then

            swFeat.Select2 False, -1

            swModel.Extension.DeleteSelection2 swDeleteSelectionOptions_e.swDelete_Absorbed

        End If

        Set swFeat = swFeat.GetNextFeature

    Wend

   

End Sub

SolidworksApi macros