Sometimes macros shift to anothr word windw.How can I prevent that

M

Marceepoo

Sometimes, my vba Word macros (which I intended to work only on the topmost
window) shift to a second Word document window, and execute in the second
Window. Where can I find info about how to prevent that from happening?
Any suggestions would be much appreciated.

marceepoo
 
J

Jezebel

Unless your macro really needs to do things with the display, the good
approach is to make the macro work explicitly with the document and its
ranges, independent of any particular window. Ie, don't use the Selection
object.
 
Top