When the code is running in Visual Studio Tool Application (VSTA) that is connected to 3D Experience part design, it shows the respective error that is attached below saying that "The method ActiveDocument failed". But, if I click on "OK", then it get executed and gives the results. But as I cannot click on "OK" always, I wanted to solve this issue. If someone knows about this, kindly help me with this. The error Image and the video related to the situation faced are attached below, kindly check them and help me.