Get the number of times a dependent model is used in an assembly

I need to find the number of times every single dependent part is used in a particular assembly. I do not wish to create a BOM table and traverse through the rows. Additionally, the numbering system is not consistent due to deleted parts. For example, I could not simply search for xxxxxxx-1 because the only instance of that part could be xxxxxx-4 or something.

I appreciate the help

Patrick

SolidworksApi macros