Get all the dimensions in a part document and output in an excel table

Help anyone.

I need a macro that will get all the dimensions in a part document and data will be tabulated in an excel sheet.

A friend in the office have created the attached macro. Problem is: the sketch dimension duplicates in feature-based dimension. What do you think is the macro missing?

Any help will be greatly appreciated. Thanks in advance.

SolidworksApi macros