List of parts Excluded from BOM

Hi All,

Need help to get a list of Exluded from BOM Parts to excel or text file.

I tried by editing existing macros to get the result but got stuck at a point. Refer the below pasted macro and help me out.

SolidworksApi macros