Macro for BOM

Hi...

I made a macro for taking out hierarchical data of assembly file. It also gives me last saved location for missing part/sub-assly which are in suppressed state. It is working very much fine except for one problem.

Problem : I am not able to handle repitition in that. It check all components indivisualy and gives me result. What I need is if in assly or sub-assly a component part is used more then once it should give me qty and instead of writing same data again.

Refer attached spreadsheet for understanding

SolidworksApi macros