Insert an excel table with macro in a solidworks MEP

Hello

I would like to make a table of nomenclature of welded parts where I would have references of profiles in a column, and by means of a macro, replace the references of the profiles with images corresponding to the profiles (for the workshop, an image of the profile in question is more meaningful than a reference).

So I managed to make an Excel file with the corresponding macro, which works. However, for now I manually extract my Solidworks BOM, which I therefore save in .xls format, then I open it on Excel, I copy the data, then I paste it into my Excel file where there is my macro, then launch it and finally I copy/paste this table into my Solidworks MEP.

My request being that I would like to remove a lot of possible manipulation (that it does everything automatically by launching a Solidworks macro would be best).

For this, I thought of 2 solutions:

- The 1st would be to create a macro in Solidworks that would make  me:

          1- Extract the bill of materials in excel format

          2- Open the BOM on Excel

          3- Open the Excel file where there is my macro

          4- Copy/paste all the cells of my extracted nomenclature to the file with al macro

          5- Launch the macro

          6- Copy/paste all the cells of the Excel file with the macro to the Solidworks MEP

- The 2nd is to retrieve the custom properties of the part (or part file) in question but I don't know how to program it in VBA

If anyone has any leads to give me...

Thank you in advance.

 

PS: I put the file with macro in PJ if it can be useful.


fichier_avec_macro.xlsm