Travese Assembly to filter out the toolbox type of part ?

Hi Guys,

I am trying to program a exe to traverse the assembly design tree. However, when I try to filter the part that is toolbox type, it could not run and pop out the error message as below screen capture indicate:

I attached the sample project of VB.NET and source code, and pls help to give some advice. thank you.

regards

Vincent

SolidworksApi/macros