Exporting volume ( in US Gallons ) from mass properties into excel

I have a part that contains 2 soild bodies, and want to export volume of one of them into excel for every configuration.

Can we right a macro to do the same and I have no idea how to right a macro or anything related to coding , so would need a detailed explanation for the same.

Please help.

SolidworksApi macros