Quantity in Part from Assembly: Excluded from BOM

I am using the macro from https://forum.solidworks.com/thread/39750 to count quantities in an assembly and write them to a custom property in each part.  This code skips any lightweight or suppressed components. 

Is there any way to determine if a component is set to "Excluded from BOM" and skip it during the count? 

Thanks for any help! 

SolidworksApi macros