The best possible solution to avoid this issue is by adding breakpoints to the best places. This issue is common with VBA and C# while debugging code includes COM libraries.