A workaround is to not activate the object while running the automation
code. However, if you need to activate the object, do so in a separate
window instead of using in-place activation. For example, this line
activates the object in a separate window:
Another workaround is to deactivate the object before calling the
automation code that causes Visual Basic to hang. For example, the PrintOut
and Delete methods cause this problem to occur. Before using these methods,
you can deactivate the object prior to calling the method, then optionally
reactivate the object after calling the method. See the MORE INFORMATION
section later in this article for an example.