First of all, my apologies for the slowness of the response (urgency to manage...)
First in the first place in PJ the txt of the macro code. (The lines of code after where the crash occurs have not been modified and are still to be adapted.
Then to answer the various questions
@remrem
The macro crashes on the next line with an undefined 91 variable object or block with code
Set swModelDocExt = swModelDoc.Extension
No, I don't check the appearance of the assembly because it's the one I want to modify...
@Bbarrand
I don't understand... When I apply the color it is to the whole part file...