I have a bunch of VB script in Excel that ultimately opens up a new Word document and places a bunch of information in it. Everything works well, but I am having one annoyance. The annoyance is that sometimes the Word document will open in front of everything else and sometimes it will open behind everything else.
I have tried duplicating the results and it appears to be random. Sometimes I think there is something consistent as to why it does it and then something happens so my theory doesn’t hold true. I must have generated the Word document over 100 times trying different stuff and can’t seem to figure it out.
I do have three monitors, running Office 2010, and Windows 7. I am not sure if the three monitors would have any affect as to why it isn’t consistent.
What I want is for it to be visible in front of everything when it opens.
This is the code I am using to make it visible and I tried it at the end, the beginning, and then at both the end and beginning of where it creates the document:
wrdApp.Activate
wrdApp.Visible = True
Anybody have any suggestions?
VBA
? (vbscript and VBA are not the same thing) – chris neilsen Nov 11 '13 at 8:19wrdApp
is created – chris neilsen Nov 11 '13 at 8:25