There is a function on the part item type (might be on several) that is share, under share there is the export to excel.
However I fail to understand what method is called.
The reason for my question is that I want to copy it and change it to fit my purpose.