Given a part number, how do you determine its row index in a BOM table?

Situation:

     I am currently programming a macro in VBA for use in Solidworks 2010.  I currently have a working macro to copy all BOMs located in all drawing files in our vault to excel, then run a macro to cross-reference the parts that I want to be "hidden" in the solidworks BOM table.  I am currently working on a function to go back to Solidworks and then hide the said rows in the BOMs.  I know very little about Solidworks, but am knowledgable about VBA.

Problem:

     I know how to open a specific drawing, traverse to find and select a specific BOM, but I am having difficulty determining which row in the BOM contains the part number to be hidden.  Given a part number that you know exists in a BOM table, how can you determine row index & then hide said row?

My thoughts:

     I have attempted to use the API help file "Get Components in Each BOM Table Row Example (VBA)" to find the correct row in a BOM, but the line; "swBOMTableAnn.GetComponentsCount2(J, ConfigName, ItemNumber, PartNumber)" is giving me a "Run-time error '438".  I realize the API help example is designed to run off their example file, but I can not determine what the difference is between the example file and my file.

     Is it easier to just delete the BOM table and then import a new "GeneralTable" containing only the items that I want to be there?

SolidworksApi macros